From d37705391ef3988967f3bac5e80d6c5817e70111 Mon Sep 17 00:00:00 2001 From: Eric Schulte Date: Fri, 17 Dec 2010 13:31:09 -0700 Subject: [PATCH] allow specification of table*, tabularx and tabulary table environments e.g. #+CAPTION: A wide table with tabulary #+LABEL: tbl:wide #+ATTR_LaTeX: table* tabulary width=\textwidth align=l|lp{3cm}r|l | 1 | 2 | 3 | | 4 | 5 | 6 | #+CAPTION: A normal table with tabularx #+LABEL: tbl:wide #+ATTR_LaTeX: table tabularx width=\textwidth align=l|lp{3cm}r|l | 1 | 2 | 3 | | 4 | 5 | 6 | Thanks to Tom Dye for suggestions and LaTeX background knowledge. * lisp/org-latex.el (org-export-latex-tables): Allowing specification of tabular[xy] inner environments through the ATTR_LaTeX line. --- lisp/org-latex.el | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/lisp/org-latex.el b/lisp/org-latex.el index a26117145..700ea18bc 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -1741,7 +1741,8 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." (org-table-last-column-widths (copy-sequence org-table-last-column-widths)) fnum fields line lines olines gr colgropen line-fmt align - caption shortn label attr floatp placement longtblp) + caption shortn label attr floatp placement + longtblp tblenv tabular-env) (if org-export-latex-tables-verbatim (let* ((tbl (concat "\\begin{verbatim}\n" raw-table "\\end{verbatim}\n"))) @@ -1758,6 +1759,17 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." 'org-label raw-table) longtblp (and attr (stringp attr) (string-match "\\" attr)) + tblenv (if (and attr (stringp attr) + (string-match (regexp-quote "table*") attr)) + "table*" "table") + tabular-env + (if (and attr (stringp attr) + (string-match "\\(tabular.\\)" attr)) + (match-string 1 attr) + org-export-latex-tabular-environment) + width (and attr (stringp attr) + (string-match "\\