Browse Source

org-e-latex: Fix small bug

* contrib/lisp/org-e-latex.el (org-e-latex--table.el-table): Fix small
  bug.
Nicolas Goaziou 5 years ago
parent
commit
b5bfebb568
1 changed files with 13 additions and 12 deletions
  1. 13 12
      contrib/lisp/org-e-latex.el

+ 13 - 12
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.