From: Nicolas Goaziou Date: Wed, 21 Nov 2012 16:31:32 +0000 (+0100) Subject: org-e-latex: Fix small bug X-Git-Tag: release_8.0-pre~797 X-Git-Url: https://repo.or.cz/w/org-mode.git/commitdiff_plain/b5bfebb568d75cdf72332888e0fe8fa594d72dc5 org-e-latex: Fix small bug * contrib/lisp/org-e-latex.el (org-e-latex--table.el-table): Fix small bug. --- diff --git a/contrib/lisp/org-e-latex.el b/contrib/lisp/org-e-latex.el index 77fdd7eb9..9fa5f30c8 100644 --- a/contrib/lisp/org-e-latex.el +++ b/contrib/lisp/org-e-latex.el @@ -2393,18 +2393,19 @@ property." ;; Remove left out comments. (while (string-match "^%.*\n" output) (setq output (replace-match "" t t output))) - ;; When the "rmlines" attribute is provided, remove all hlines but - ;; the the one separating heading from the table body. - (when (org-export-read-attribute :attr_latex table :rmlines) - (let ((n 0) (pos 0)) - (while (and (< (length output) pos) - (setq pos (string-match "^\\\\hline\n?" output pos))) - (incf n) - (unless (= n 2) (setq output (replace-match "" nil nil output)))))) - (let ((centerp (if (plist-member attr :center) (plist-get attr :center) - org-e-latex-tables-centered))) - (if (not centerp) output - (format "\\begin{center}\n%s\n\\end{center}" output))))) + (let ((attr (org-export-read-attribute :attr_latex table))) + (when (plist-get attr :rmlines) + ;; When the "rmlines" attribute is provided, remove all hlines + ;; but the the one separating heading from the table body. + (let ((n 0) (pos 0)) + (while (and (< (length output) pos) + (setq pos (string-match "^\\\\hline\n?" output pos))) + (incf n) + (unless (= n 2) (setq output (replace-match "" nil nil output)))))) + (let ((centerp (if (plist-member attr :center) (plist-get attr :center) + org-e-latex-tables-centered))) + (if (not centerp) output + (format "\\begin{center}\n%s\n\\end{center}" output)))))) (defun org-e-latex--math-table (table info) "Return appropriate LaTeX code for a matrix.