Browse Source

LaTeX export: Fix another protection bug, this time the char before a "\"

Carsten Dominik 15 years ago
parent
commit
8fd14ae648
2 changed files with 10 additions and 4 deletions
  1. 5 0
      lisp/ChangeLog
  2. 5 4
      lisp/org-latex.el

+ 5 - 0
lisp/ChangeLog

@@ -1,3 +1,8 @@
+2010-01-15  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* 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  <carsten.dominik@gmail.com>
 
 	* org-agenda.el (org-diary-class): Use

+ 5 - 4
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$