emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Is it possible to "properly" indent inside latex fragments?


From: Charles C. Berry
Subject: Re: [O] Is it possible to "properly" indent inside latex fragments?
Date: Mon, 23 Jan 2017 08:44:05 -0800
User-agent: Alpine 2.20 (OSX 67 2015-01-07)

On Mon, 23 Jan 2017, address@hidden 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]