浏览代码

org-e-latex: Fix small bug

* contrib/lisp/org-e-latex.el (org-e-latex--table.el-table): Fix small
  bug.
Nicolas Goaziou 12 年之前
父节点
当前提交
b5bfebb568
共有 1 个文件被更改,包括 13 次插入12 次删除
  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.