From 8fd14ae6489372f38a9d043bc348ff1e1e84f1c4 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Fri, 15 Jan 2010 08:05:22 +0100 Subject: [PATCH] LaTeX export: Fix another protection bug, this time the char before a "\" --- lisp/ChangeLog | 5 +++++ lisp/org-latex.el | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 88cd22ed9..e47906f3d 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-01-15 Carsten Dominik + + * org-latex.el (org-export-latex-treat-backslash-char): Do not by + accident protect a character that is before a backslash. + 2010-01-14 Carsten Dominik * org-agenda.el (org-diary-class): Use diff --git a/lisp/org-latex.el b/lisp/org-latex.el index 97327b72f..9d4ebc436 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -1441,14 +1441,15 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." ((and (not (string-match "^[ \n\t]" string-after)) (not (string-match "[ \t]\\'\\|^" string-before))) ;; backslash is inside a word - (org-export-latex-protect-string - (concat string-before "\\textbackslash{}" string-after))) + (concat string-before + (org-export-latex-protect-string + (concat "\\textbackslash{}" string-after)))) ((not (or (equal string-after "") (string-match "^[ \t\n]" string-after))) ;; backslash might escape a character (like \#) or a user TeX ;; macro (like \setcounter) - (org-export-latex-protect-string - (concat string-before "\\" string-after))) + (concat string-before + (org-export-latex-protect-string (concat "\\" string-after)))) ((and (string-match "^[ \t\n]" string-after) (string-match "[ \t\n]\\'" string-before)) ;; backslash is alone, convert it to $\backslash$