Browse Source

LaTeX export: Fix bug with accidental multiline protection in comments

Carsten Dominik 15 years ago
parent
commit
97ecc2c180
2 changed files with 7 additions and 2 deletions
  1. 3 0
      lisp/ChangeLog
  2. 4 2
      lisp/org-latex.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-09-06  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-latex.el (org-export-latex-preprocess): Do not protect in
+	the LaTeX header.
+
 	* org-src.el (org-edit-src-save): Save window setup while saving.
 	(org-edit-src-code): Use new buffer name construction scheme.
 

+ 4 - 2
lisp/org-latex.el

@@ -1691,8 +1691,10 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
 		    "\\)?"
 		    (org-create-multibrace-regexp "{" "}" 3))))
     (while (re-search-forward re nil t)
-      (add-text-properties (match-beginning 0) (match-end 0)
-			   '(org-protected t))))
+      (unless (save-excursion (goto-char (match-beginning 0))
+			      (equal (char-after (point-at-bol)) ?#))
+	(add-text-properties (match-beginning 0) (match-end 0)
+			     '(org-protected t)))))
 
   ;; Protect LaTeX entities
   (goto-char (point-min))