From: Bastien Guerry <bzg@altern.org>
To: emacs-orgmode@gnu.org
Subject: [Accepted] Protect starred commands in LaTeX export correctly
Date: Wed, 23 Mar 2011 15:05:47 +0100 (CET) [thread overview]
Message-ID: <20110323140547.D5759715E@myhost.localdomain> (raw)
In-Reply-To: m3zkom15w6.fsf_-_@e4300lm.epcc.ed.ac.uk
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 <wence@gmx.li>
> X-Patchwork-Id: 712
> Message-Id: <m3zkom15w6.fsf_-_@e4300lm.epcc.ed.ac.uk>
> 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 <eric@ericabrahamsen.net> 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]*>\\)*"
>
next prev parent reply other threads:[~2011-03-23 14:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-23 4:07 escaping of #+TEXT lines: \vspace vs \vspace* Eric Abrahamsen
2011-03-23 9:00 ` Eric S Fraga
2011-03-23 10:28 ` [PATCH] Protect starred commands in LaTeX export correctly Lawrence Mitchell
2011-03-23 11:28 ` Eric Abrahamsen
2011-03-23 14:05 ` Bastien Guerry [this message]
2011-03-23 14:11 ` Eric S Fraga
2011-03-23 14:16 ` Bastien
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=20110323140547.D5759715E@myhost.localdomain \
--to=bzg@altern.org \
--cc=emacs-orgmode@gnu.org \
/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).