From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: LaTeX export: {} on separate lines are escaped, why? Date: Sat, 27 Jul 2013 20:40:45 +0200 Message-ID: <87ehaj3kya.fsf@gmail.com> References: <87li4s2k9a.wl%jamshark70@dewdrop-world.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V39Q7-0003gt-Eq for emacs-orgmode@gnu.org; Sat, 27 Jul 2013 14:40:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V39Pu-0004go-Ot for emacs-orgmode@gnu.org; Sat, 27 Jul 2013 14:40:47 -0400 Received: from mail-we0-x236.google.com ([2a00:1450:400c:c03::236]:56775) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V39Pu-0004gg-9m for emacs-orgmode@gnu.org; Sat, 27 Jul 2013 14:40:34 -0400 Received: by mail-we0-f182.google.com with SMTP id u55so2870439wes.27 for ; Sat, 27 Jul 2013 11:40:33 -0700 (PDT) In-Reply-To: <87li4s2k9a.wl%jamshark70@dewdrop-world.net> (James Harkins's message of "Sat, 27 Jul 2013 09:41:05 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: James Harkins Cc: orgmode Hello, James Harkins 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