Hello,

James Harkins <jamshar...@gmail.com> 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