From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Guerry Subject: [Accepted] Protect starred commands in LaTeX export correctly Date: Wed, 23 Mar 2011 15:05:47 +0100 (CET) Message-ID: <20110323140547.D5759715E@myhost.localdomain> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=43393 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q2OhU-0006Wh-BV for emacs-orgmode@gnu.org; Wed, 23 Mar 2011 10:06:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q2OhK-00030F-Mm for emacs-orgmode@gnu.org; Wed, 23 Mar 2011 10:06:16 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:61909) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q2OhK-0002zx-GH for emacs-orgmode@gnu.org; Wed, 23 Mar 2011 10:06:06 -0400 Received: by wyf19 with SMTP id 19so8821285wyf.0 for ; Wed, 23 Mar 2011 07:06:05 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Patch 712 (http://patchwork.newartisans.com/patch/712/) is now "Accepted". Maintainer comment: none This relates to the following submission: http://mid.gmane.org/%3Cm3zkom15w6.fsf_-_%40e4300lm.epcc.ed.ac.uk%3E Here is the original message containing the patch: > Content-Type: text/plain; charset="utf-8" > MIME-Version: 1.0 > Content-Transfer-Encoding: 7bit > Subject: [O] Protect starred commands in LaTeX export correctly > Date: Wed, 23 Mar 2011 15:28:04 -0000 > From: Lawrence Mitchell > X-Patchwork-Id: 712 > Message-Id: > To: emacs-orgmode@gnu.org > > * lisp/org-latex.el (org-export-latex-preprocess): Correctly > match starred command names. > > Many LaTeX commands exist in both normal and starred forms. Adjust > the regexp in `org-export-latex-preprocess' to match the starred form > as well. > > --- > lisp/org-latex.el | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > Eric S Fraga wrote: > > > Eric Abrahamsen writes: > > >> Hi, > > >> In a certain org file I put this line into the export options: > > >> #+begin_src org-mode > >> #+TEXT: \vspace*{0.5in} > >> #+end_src > > > Should this not be > > > > #+LATEX: \vspace*{0.5in} > > > instead of TEXT? > > > [...] > > > One could argue that the latex escaping that org does should > > include *'ed commands as well... but this may have other repercussions > > that I am not aware of. > > Indeed it probably should, here's a patch that does exactly that, > avoiding the need for the above workaround. With this change > \vspace*{1cm} is correctly exported like \vspace{1cm}. > > diff --git a/lisp/org-latex.el b/lisp/org-latex.el > index 2acc169..912ebba 100644 > --- a/lisp/org-latex.el > +++ b/lisp/org-latex.el > @@ -2364,7 +2364,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." > ;; Protect LaTeX commands like \command[...]{...} or \command{...} > (goto-char (point-min)) > (let ((re (concat > - "\\\\\\([a-zA-Z]+\\)" > + "\\\\\\([a-zA-Z]+\\*?\\)" > "\\(?:<[^<>\n]*>\\)*" > "\\(?:\\[[^][\n]*?\\]\\)*" > "\\(?:<[^<>\n]*>\\)*" >