Q: how can I get "proper" indentation of LaTeX itemize
environments in auctex
?
Here's where I'd like to be with an item
in an itemize
environment:
\item
line is indented two spaces relative to the beginning of the environment- continuation lines in the item are indented an additional two spaces relative to the
\item
line
This is what I would like/expect to see:
\begin{itemize}
\item Here's a really long item in a LaTeX itemize environment;
note how the *initial* item line is indented two spaces, and the
continuation lines are indented another two spaces.
\end{itemize}
One can adjust the initial indentation of the item with the LaTeX-item-indent
variable, which defaults to -2
. With this default, I get the undesirable behavior of the \item
not being indented, but I do get the desired behavior of the continuation lines being offset by an additional two spaces:
\begin{itemize}
\item Here's a really long item in a LaTeX itemize environment;
note how the *initial* item line is *NOT* indented two spaces,
but the continuation lines are indented two spaces.
\end{itemize}
Setting LaTeX-item-indent
to 0
gets me the desired indentation on the \item
line (two spaces in), but does not get me the second half of the desired behavior of the continuation lines being offset by an additional two spaces:
\begin{itemize}
\item Here's a really long item in a LaTeX itemize environment;
note how the *initial* item line is indented two spaces, but the
continuation lines are *NOT* indented an additional two spaces.
\end{itemize}
So: how does one get both desired behaviors:
- initial indent of the
\item
line two spaces, and - continuation lines an additional two spaces indented?
(Note Related SO thread.)
LaTeX-indent-level
to 4. Items will be indented to 4 - 2 = 2 and continuation lines will be indented to 4 = 2 + 2. However, this does mean that every other environment in the file will be indented to 4 (and not 2), which may or may not be desirable. I'd rather they be indented at 2 themselves, which is where I'm stuck.LaTeX-indent-environment-list
and adding a custom function for indentation? The functionLaTeX-indent-tabular
might provide a reasonable starting point (or at least a reasonable example of customized indentation within an environment). I just stumbled across this variable/function, so I haven't had a chance to look into it myself.