Sublime Forum

Auto-indent has changed to 2 spaces in new tabs

#1

I have some latex files open in old tabs. When I, e.g., begin an new environment, it automatically indents the contents of that environment by 4 spaces.

Somehow, I have disturbed things such that any new file I open, the indentation is 2 spaces. What did I do? How do I get 4 spaces back?

I have tried resetting my LaTeXTools settings to default, deleted temporary files, cleared cache. I’m out of ideas.

Thank you!

0 Likes

#2

To be more clear, here is the minimal example.

Old tab: Ctl-n to new document and I get the desired behaviour still:

\documentclass{article}
\begin{document}
\begin{itemize}
   item %% <-----------------
\end{itemize}
\end{document}

Opening a new file from command line or from Ctl-n from a new tab, and the indent is 2 spaces

0 Likes

#3

Does it happen in safe mode?

0 Likes

#4

Just checked. Yes. Now that I’ve restarted, I’m getting 2 spaces everywhere.

0 Likes

#5

Sorry, scratch that. I can still Ctl-n, and paste ‘\documentclass{article}’, into the blank document, then type ‘begin’, [Tab] and I get 4 spaces again.

0 Likes

#6

I’m going to consider this solved. Below is a minimal example where the behaviour toggles based on which ‘titleformat’ line is commented out when the file is opened. But this is inconsistent across my many other files which all contain this line in the preamble.

\documentclass{article}

\usepackage{titlesec}
\titleformat{\section}{} %
{}{}{}[]

% \titleformat{\section}{}{}{}{}[]

\begin{document}

\end{document}

0 Likes