It seems that latex-suite do the auto indent wrong when there are no closed bracks, for example, in the following $[0,1)$ is the cause of problem:
\begin{equation}
f(x),\quad x\in[0,1)
\end{equation}
will indent to
\begin{equation}
f(x),\quad x\in[0,1)
\end{equation}
is there a way to solve it? (if I replace $[0,1)$ with $[0,1]$ then the indent work again).
UPDATE
I just install one plugin, i.e., vim-latex or latex-suite (is this the old name?). And after a while, I found the problem is caused by these lines in vim-latex\indent\tex.vim
if g:tex_indent_brace
" Add a 'shiftwidth' after a "{" or "[" while there are not "}" and "]"
" after them. \m for magic
if line =~ '\m\(\(\[[^\]]*\)\|\({[^}]*\)\)$'
"let ind = ind + &sw
endif
" Remove a 'shiftwidth' after a "}" or "]" while there are not "{" and "["
" before them. \m for magic
if cline =~ '\m^\(\([^[]*\]\)\|\([^{]*}\)\)'
"let ind = ind - &sw
endif
endif
as you can see, I comment out two lines of if...endif, and which will stop indent for { and [. And my example will output (do gg = G):
\begin{equation}
f(x),\quad x\in[0,1)
\end{equation}
BUT, it also mess up something, such as
\newcommand{set}[1]{%
\left\{#1\right\}%
}
rather than
\newcommand{set}[1]{%
\left\{#1\right\}%
}
so, there still need some solution to fix this.
℅}to the end of the offending line? – cxw Aug 20 '15 at 09:48latexindentto do the indentation? or are you using another tool? I can confirm the behaviour you describe usinglatexindent– cmhughes Aug 20 '15 at 13:47latexindent, then I can provide a number of fixes; you might also have a look atSection 4.5: An important examplein the documentation :) It's very similar to your question – cmhughes Aug 20 '15 at 16:12%}at the end of that line, then no indent of that line. – user19832 Aug 21 '15 at 07:56latexindent, is it a plugin independent tovim-latexorlatex-suite? I only uselatex-suiteand do the recommand setting as said in the official site. – user19832 Aug 21 '15 at 07:57:help latex-suite.txthas no section 4.5. – user19832 Aug 21 '15 at 07:58e6972acfrom 2017-12-09. – rkta Aug 23 '18 at 17:39