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.
This commit is contained in:
Carsten Dominik 2009-01-17 15:07:10 +01:00
parent a4244d5783
commit fee4492f57
3 changed files with 16 additions and 3 deletions

View File

@ -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

View File

@ -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)

View File

@ -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)))