On Mon, 23 Jan 2017, alain.coch...@unistra.fr wrote:
Hello.
This is what I obtain if I type each line followed by <Enter> and then
<TAB> in an org file:
* foo
\begin{displaymath}
\begin{split}
a &= b \\
&+c
\end{split}
\end{displaymath}
If I highlight everything and use 'M-x indent-region' or 'M-x
org-indent-region', it does not change.
Instead, what I would like to get is:
* foo
\begin{displaymath}
\begin{split}
a &= b \\
&+c
\end{split}
\end{displaymath}
(That specific indentation for the latex instructions is what I obtain
within a .tex file.)
Is it possible?
With export blocks you can get close.
If you type =C-c '= inside the following export block, you will get the
contents in a latex buffer. Then indentation and other LATEX/P mode
operations are available. When you exit with another =C-c '= the
indentation is preserved.
#+BEGIN_EXPORT latex
\begin{displaymath}
\begin{split}
a &= b \\
&+c
\end{split}
\end{displaymath}
#+END_EXPORT
HTH,
Chuck