emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] LaTeX export: {} on separate lines are escaped, why?


From: Nicolas Goaziou
Subject: Re: [O] LaTeX export: {} on separate lines are escaped, why?
Date: Sat, 27 Jul 2013 20:40:45 +0200

Hello,

James Harkins <address@hidden> writes:

> Just wondering if there's a better way to handle LaTeX commands
> written inline, when the command arguments span a line break.
> Currently, LaTeX export preserves curly braces as is if a pair of them
> is on a single line, but it escapes them if there's a line break in
> between:
>
> ~~ org
> Sections may be created as subpatches, using \inpcode{[route go
> stop]} to start or stop the section, as in the very simple example in
> Figure \ref{pd_comp}a.
> ~~
>
> ~~ Exported LaTeX:
> Sections may be created as subpatches, using \codeident\{[route go
> stop]\} to start or stop the section, as in the very simple example in
> Figure \ref{pd_comp}a.
> ~~

Org syntax has a very limited support for LaTeX commands. Usual regexp
used is:

  "\\\\[a-zA-Z]+\\*?\\(\\(\\[[^][\n{}]*\\]\\)\\|\\({[^{}\n]*}\\)\\)*"

As you can see, newline characters are explicitly forbidden.

We could extend quite easily this support to more complex commands, but
I'm not sure we should encourage this. By essence, LaTeX macros are not
very portable. Luckily, there's a syntax for non-portable code: export
snippets. Thus, you can write:

  Sections may be created as subpatches, using @@latex:\inpcode{[route go
  stop]}@@ to start or stop the section, as in the very simple example in
  Figure \ref{pd_comp}a.

I think it is better than improving LaTeX commands support.

As a side note, I suggest to use Org cross reference syntax instead of
writing \ref{...} explicitly.


Regards,

-- 
Nicolas Goaziou



reply via email to

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