all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Charles C. Berry" <ccberry@ucsd.edu>
To: Alain Cochard <Alain.Cochard@unistra.fr>
Cc: emacs-orgmode@gnu.org
Subject: Re: Is it possible to "properly" indent inside latex fragments?
Date: Mon, 23 Jan 2017 08:44:05 -0800	[thread overview]
Message-ID: <alpine.OSX.2.20.1701230836240.715@charles-berrys-macbook.local> (raw)
In-Reply-To: <22662.9637.821790.492211@frac.u-strasbg.fr>

On Mon, 23 Jan 2017, Alain.Cochard@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

  reply	other threads:[~2017-01-23 16:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-23 15:47 Is it possible to "properly" indent inside latex fragments? Alain.Cochard
2017-01-23 16:44 ` Charles C. Berry [this message]
2017-02-01 19:05   ` Alain.Cochard
2017-02-01 20:34     ` Nicolas Goaziou
2017-02-03  0:47       ` Alain.Cochard
2017-02-03 21:04         ` Nicolas Goaziou
2017-02-04 12:55           ` Alain.Cochard
2017-03-03  8:14           ` Alain.Cochard
2017-03-03 11:26             ` Nicolas Goaziou
2017-03-03 16:29               ` Alain.Cochard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.OSX.2.20.1701230836240.715@charles-berrys-macbook.local \
    --to=ccberry@ucsd.edu \
    --cc=Alain.Cochard@unistra.fr \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.