Преглед изворни кода

Improve environment quoting for LaTeX export.

Carsten Dominik пре 16 година
родитељ
комит
16e030620a
3 измењених фајлова са 11 додато и 6 уклоњено
  1. 5 0
      lisp/ChangeLog
  2. 0 1
      lisp/org-exp.el
  3. 6 5
      lisp/org-export-latex.el

+ 5 - 0
lisp/ChangeLog

@@ -1,3 +1,8 @@
+2008-10-14  Carsten Dominik  <dominik@science.uva.nl>
+
+	* org-export-latex.el (org-export-latex-preprocess): Improve
+	quoting of LaTeX environments.
+
 2008-10-10  Carsten Dominik  <dominik@science.uva.nl>
 
 	* org.el (org-edit-fixed-width-region): Exclude final newline from

+ 0 - 1
lisp/org-exp.el

@@ -1496,7 +1496,6 @@ on this string to produce the exported version."
       ;; Remove or replace comments
       (org-export-handle-comments (plist-get parameters :comments))
 
-
       (setq rtn (buffer-string)))
     (kill-buffer " org-mode-tmp")
     rtn))

+ 6 - 5
lisp/org-export-latex.el

@@ -1110,11 +1110,12 @@ If TIMESTAMPS, convert timestamps, otherwise delete them."
 
   ;; Preserve latex environments
   (goto-char (point-min))
-  (while (search-forward "\\begin{" nil t)
-    (let ((start (progn (beginning-of-line) (point)))
-          (end (or (and (search-forward "\\end{" nil t)
-                        (end-of-line) (point))
-                   (point-max))))
+  (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)
+			  (point-at-eol)))
+		    (point-max))))
       (add-text-properties start end '(org-protected t))))
 
   ;; Convert LaTeX to \LaTeX{}