I am currently using songs package, which via some TeX trickery uses escaped brackets to mark chords (for example \[G]
is G-major, while \[a]
is a-minor). This causes problems with indentation, for example this is how the following snippet gets indented (every \[
introduces new indent level):
\begin{song}
\begin{verse}
\[G]This is \[D]some \[A]guitar song
\[G]annotated with \[D]the chords
to \[e]make playing ea\[H7]sier.
\end{verse}
\end{song}
while of course I would like to get:
\begin{song}
\begin{verse}
\[G]This is \[D]some \[A]guitar song
\[G]annotated with \[D]the chords
to \[e]make playing ea\[H7]sier.
\end{verse}
\end{song}
I managed to resolve this by removing bracket indentation completely:
(setq LaTeX-begin-regexp "begin\\b") ; Default is begin\\b\\|\\[
(setq LaTeX-end-regexp "end\\b") ; Default is end\\b\\|\\]
but this impacts also my various other uses of \[
, including math…
So, the question is, whether it is possible to disable indenting behaviour of bracket just inside specific environment (song
), while leaving it unchanged everywhere else.
If impossible, what is the easiest/recommended way to change LaTeX-begin-regex
and LaTeX-end-regexp
just for specific files instead of customizing it globally?