Ver Fonte

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.
Nicolas Goaziou há 15 anos atrás
pai
commit
33445118cf
1 ficheiros alterados com 3 adições e 2 exclusões
  1. 3 2
      lisp/org-latex.el

+ 3 - 2
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