瀏覽代碼

LaTeX export: Allow uncentered tables

Carsten Dominik 16 年之前
父節點
當前提交
80fb1b566a
共有 2 個文件被更改,包括 12 次插入2 次删除
  1. 3 0
      lisp/ChangeLog
  2. 9 2
      lisp/org-latex.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-05-13  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* org-latex.el (org-export-latex-tables-centered): New option.
+	(org-export-latex-tables): Use `org-export-latex-tables-centered'.
+
 	* org-exp.el (org-export-as-org): New command.
 	(org-export-as-org): New command.
 

+ 9 - 2
lisp/org-latex.el

@@ -231,6 +231,11 @@ markup defined, the first one in the association list will be used."
   :group 'org-export-latex
   :type 'boolean)
 
+(defcustom org-export-latex-tables-centered t
+  "When non-nil, tables are exported in a center environment."
+  :group 'org-export-latex
+  :type 'boolean)
+
 (defcustom org-export-latex-tables-column-borders nil
   "When non-nil, grouping columns can cause outer vertical lines in tables.
 When nil, grouping causes only separation lines between groups."
@@ -1291,7 +1296,8 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
 			   (if label (concat "\\\label{" label "}") "")
 			   (or caption "")))
 		      (if longtblp "\\\\\n" "\n")
-		      (if (not longtblp) "\\begin{center}\n")
+		      (if (and org-export-latex-tables-centered (not longtblp))
+			  "\\begin{center}\n")
 		      (if (not longtblp) (concat "\\begin{tabular}{" align "}\n"))
 		      (orgtbl-to-latex
 		       lines
@@ -1305,7 +1311,8 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
 \\endlastfoot" (length org-table-last-alignment))
 					   nil)))
 		      (if (not longtblp) (concat "\n\\end{tabular}"))
-		      (if longtblp "\n" "\n\\end{center}\n")
+		      (if longtblp "\n" (if org-export-latex-tables-centered
+					    "\n\\end{center}\n" "\n"))
 		      (if longtblp
 			  "\\end{longtable}"
 			(if floatp "\\end{table}"))))