From 33445118cf2b88b3da5caf97b665c8887911e1f8 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sun, 13 Jun 2010 17:21:59 +0200 Subject: [PATCH] org-latex.el : do not protect environments already protected. Environments coming from latex backend specific instructions (#+LaTeX) are already protected and won't be treated as normal environments. * lisp/org-latex.el (org-export-latex-preprocess): Environments coming from latex backend specific instructions (#+LaTeX) are already protected and won't be treated as normal environments. --- lisp/org-latex.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/org-latex.el b/lisp/org-latex.el index 50f5299b9..edc05c665 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -1984,7 +1984,8 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." ;; Preserve latex environments (goto-char (point-min)) (while (re-search-forward "^[ \t]*\\\\begin{\\([a-zA-Z]+\\*?\\)}" nil t) - (let* ((start (progn (beginning-of-line) (point))) + (org-if-unprotected + (let* ((start (progn (beginning-of-line) (point))) (end (and (re-search-forward (concat "^[ \t]*\\\\end{" (regexp-quote (match-string 1)) @@ -1992,7 +1993,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." (point-at-eol)))) (if end (add-text-properties start end '(org-protected t)) - (goto-char (point-at-eol))))) + (goto-char (point-at-eol)))))) ;; Preserve math snippets