* 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 <e...@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]*>\\)*" -- 1.7.4.rc2.18.gb20e9