소스 검색

Export: Fix bug with LaTeX export of tables.

The special first column in some tables was not removed for LaTeX
export.  This bug was probably introduces recently, while trying to
fix problems with special characters in LaTeX tables.
Export is now working again properly.

Reported by Giovanni Ridolfi.
Carsten Dominik 16 년 전
부모
커밋
fee4492f57
3개의 변경된 파일16개의 추가작업 그리고 3개의 파일을 삭제
  1. 9 0
      lisp/ChangeLog
  2. 6 2
      lisp/org-exp.el
  3. 1 1
      lisp/org-export-latex.el

+ 9 - 0
lisp/ChangeLog

@@ -1,3 +1,12 @@
+2009-01-17  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-export-latex.el (org-export-latex-tables): Call
+	`org-table-clean-before-export' with the new optional argument.
+
+	* org-exp.el (org-table-clean-before-export): New optional
+	parameter MAYBE-QUOTED, allows for quoted characters like \# in
+	first column.
+
 2009-01-16  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org-plot.el (org-plot/gnuplot): Fix text-ind parameter for

+ 6 - 2
lisp/org-exp.el

@@ -4151,14 +4151,18 @@ lang=\"%s\" xml:lang=\"%s\">
       (push html-table-tag html))
     (concat (mapconcat 'identity html "\n") "\n")))
 
-(defun org-table-clean-before-export (lines)
+(defun org-table-clean-before-export (lines &optional maybe-quoted)
   "Check if the table has a marking column.
 If yes remove the column and the special lines."
   (setq org-table-colgroup-info nil)
   (if (memq nil
 	    (mapcar
 	     (lambda (x) (or (string-match "^[ \t]*|-" x)
-			     (string-match "^[ \t]*| *\\([#!$*_^ /]\\) *|" x)))
+			     (string-match
+			      (if maybe-quoted
+				  "^[ \t]*| *\\\\?\\([\#!$*_^ /]\\) *|"
+				"^[ \t]*| *\\([\#!$*_^ /]\\) *|")
+			      x)))
 	     lines))
       (progn
 	(setq org-table-clean-did-remove-column nil)

+ 1 - 1
lisp/org-export-latex.el

@@ -1072,7 +1072,7 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
 	  (setq lines (split-string raw-table "\n" t))
 	  (apply 'delete-region (list beg end))
 	  (when org-export-table-remove-special-lines
-	    (setq lines (org-table-clean-before-export lines)))
+	    (setq lines (org-table-clean-before-export lines 'maybe-quoted)))
 	  ;; make a formatting string to reflect aligment
 	  (setq olines lines)
 	  (while (and (not line-fmt) (setq line (pop olines)))