emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] [PATCH] Fix regexp error for protecting final } when exporting


From: Julien Barnier
Subject: [Orgmode] [PATCH] Fix regexp error for protecting final } when exporting emphasis elements to latex
Date: Wed, 09 Dec 2009 15:35:20 +0100
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/23.1.50 (gnu/linux)

Hi,

I recntly noticed that in some specific cases, the final '}' was
esacped when exproting an emphasis element to LaTeX.

For example, the following element :

/éaa/

Is exported to :

\emph{éaa\}

This does not append if the string begins with a space or if it
is ASCII-only. For example, the followig strings are exported
correctly :

/aaa/
 /ééé/

I don't understand why the problem only occurs with non-ASCII chars,
but I think that the regexp to protect added special chars in the
org-export-latex-fontify function is missing a '?' in the
beginning. Tha attached patch corrects it.

Thanks for all,

Julien

---
 lisp/org-latex.el |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index ce697a3..3d25139 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -1508,7 +1508,7 @@ The conversion is made depending of STRING-BEFORE and 
STRING-AFTER."
        (if (caddr emph)
            (setq rpl (org-export-latex-protect-string rpl))
          (save-match-data
-           (if (string-match "\\`.\\(\\\\[a-z]+{\\)\\(.*\\)\\(}\\).?\\'" rpl)
+           (if (string-match "\\`.?\\(\\\\[a-z]+{\\)\\(.*\\)\\(}\\).?\\'" rpl)
                (progn
                  (add-text-properties (match-beginning 1) (match-end 1)
                                       '(org-protected t) rpl)
-- 
1.6.5.3





reply via email to

[Prev in Thread] Current Thread [Next in Thread]