emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: James Harkins <jamshark70@gmail.com>
Cc: orgmode <emacs-orgmode@gnu.org>
Subject: Re: LaTeX export: {} on separate lines are escaped, why?
Date: Sat, 27 Jul 2013 20:40:45 +0200	[thread overview]
Message-ID: <87ehaj3kya.fsf@gmail.com> (raw)
In-Reply-To: <87li4s2k9a.wl%jamshark70@dewdrop-world.net> (James Harkins's message of "Sat, 27 Jul 2013 09:41:05 -0400")

Hello,

James Harkins <jamshark70@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	other threads:[~2013-07-27 18:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-27 13:41 LaTeX export: {} on separate lines are escaped, why? James Harkins
2013-07-27 18:40 ` Nicolas Goaziou [this message]

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=87ehaj3kya.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=jamshark70@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).