소스 검색

LaTeX export: Protect eqnarray* and similar environments.

Environment names ending in a star were not properly protected.  Now
they are.
Carsten Dominik 16 년 전
부모
커밋
5f86fd7ae2
2개의 변경된 파일7개의 추가작업 그리고 2개의 파일을 삭제
  1. 3 0
      lisp/ChangeLog
  2. 4 2
      lisp/org-latex.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-04-29  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-latex.el (org-export-latex-preprocess): Also protect
+	environments ending in a star.
+
 	* org-list.el (org-at-item-p): Fix regular expression.
 
 2009-04-24  Carsten Dominik  <carsten.dominik@gmail.com>

+ 4 - 2
lisp/org-latex.el

@@ -1399,10 +1399,12 @@ 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)
+  (while (re-search-forward "^[ \t]*\\\\begin{\\([a-zA-Z]+\\*?\\)}" nil t)
     (let* ((start (progn (beginning-of-line) (point)))
 	   (end (or (and (re-search-forward
-			  (concat "^[ \t]*\\\\end{" (match-string 1) "}") nil t)
+			  (concat "^[ \t]*\\\\end{" 
+				  (regexp-quote (match-string 1))
+				  "}") nil t)
 			 (point-at-eol))
 		    (point-max))))
       (add-text-properties start end '(org-protected t))))