Yet another question about indentation in AUCTeX...
I would like to be able to indent content inside square brackets [...]
. It would be useful for tikz option lists, for example, or trees drawn using forest
or qtree
: both these packages use square brackets for their syntax, which makes it easy to scan in source code in an editor supporting paren-indentation.
Unfortunately, AUCTeX only indents the content of environments and content between braces {...}
.
The forest
example is also a situation where cheating by adding braces around the content we want indented won't work, because braces will escape all content from being evaluated as a tree.
Example:
\documentclass{article}
\usepackage{forest}
\begin{document}
\begin{forest}
[A
[B]
[C
[D]
[E]
]
]
\end{forest}
\end{document}
Which I would like indented as:
\documentclass{article}
\usepackage{forest}
\begin{document}
\begin{forest}
[A
[B]
[C
[D]
[E]
]
]
\end{forest}
\end{document}
Is there a way?
forest
environment? – giordano Oct 15 '15 at 12:39(modify-syntax-entry ?\[ "(]" LaTeX-mode-syntax-table) (modify-syntax-entry ?\] ")[" LaTeX-mode-syntax-table)
. – Timm Oct 25 '16 at 14:18character: [ (...) syntax: (] which means: open, matches ]
but it seems that AUCTeX's indentation mechanism disregards this information. – T. Verron Oct 25 '16 at 14:23