浏览代码

ox-latex: Fix environment for tables without caption, take 2

* lisp/ox-latex.el (org-latex--decorate-table): Check if caption is
  the empty string.
Nicolas Goaziou 6 年之前
父节点
当前提交
102142b1a5
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      lisp/ox-latex.el

+ 4 - 3
lisp/ox-latex.el

@@ -3144,8 +3144,9 @@ centered."
   "Decorate TABLE string with caption and float environment.
   "Decorate TABLE string with caption and float environment.
 
 
 ATTRIBUTES is the plist containing is LaTeX attributes.  CAPTION
 ATTRIBUTES is the plist containing is LaTeX attributes.  CAPTION
-is its caption.  It is located above the table if ABOVE? is
-non-nil.  INFO is the plist containing current export parameters.
+is its caption, as a string or nil.  It is located above the
+table if ABOVE? is non-nil.  INFO is the plist containing current
+export parameters.
 
 
 Return new environment, as a string."
 Return new environment, as a string."
   (let* ((float-environment
   (let* ((float-environment
@@ -3153,7 +3154,7 @@ Return new environment, as a string."
 	    (cond ((and (not float) (plist-member attributes :float)) nil)
 	    (cond ((and (not float) (plist-member attributes :float)) nil)
 		  ((member float '("sidewaystable" "sideways")) "sidewaystable")
 		  ((member float '("sidewaystable" "sideways")) "sidewaystable")
 		  ((equal float "multicolumn") "table*")
 		  ((equal float "multicolumn") "table*")
-		  ((or float caption) "table")
+		  ((or float (org-string-nw-p caption)) "table")
 		  (t nil))))
 		  (t nil))))
 	 (placement
 	 (placement
 	  (or (plist-get attributes :placement)
 	  (or (plist-get attributes :placement)