emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [PATCH] Add support for `ltablex'


From: Francesco Pizzolante
Subject: [O] [PATCH] Add support for `ltablex'
Date: Tue, 03 Sep 2013 16:52:40 +0200
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (windows-nt)

Hello,

Please find here a patch to support the tabularx table environment when used
in conjunction with the ltablex LaTeX package.

ltablex combines the advantages of longtable and tabularx packages: it enables
splitting of table across pages, and have fixed-width tables with
auto-adjusted columns.

Like longtable, it does not require a float table environment around.

I added a ltablex environment name which will be exported as a tabularx LaTeX
environment without a table float environment (this is the exact same behavior
as for longtable).

Usage is the same as tabularx (except that you use ltablex as :environment
name in the ATTR_LATEX specification):

- you need to specify a :width attribute, and
- an :align attribute.

In this case, like for longtable, the :float attribute is also ignored.

Best regards,
 Francesco

* ox-latex.el (org-latex--org-table): Add support for `ltablex'.

From: Francesco Pizzolante <address@hidden>
Date: Tue, 3 Sep 2013 16:44:24 +0200
Subject: [PATCH] Add support for `ltablex'

---
 lisp/ox-latex.el |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index e66c717..6af3acf 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -2350,7 +2350,7 @@ This function assumes TABLE has `org' as its `:type' 
property and
                        org-latex-default-table-environment))
         ;; If table is a float, determine environment: table, table*
         ;; or sidewaystable.
-        (float-env (unless (member table-env '("longtable" "longtabu"))
+        (float-env (unless (member table-env '("longtable" "longtabu" 
"ltablex"))
                      (let ((float (plist-get attr :float)))
                        (cond
                         ((and (not float) (plist-member attr :float)) nil)
@@ -2401,6 +2401,21 @@ This function assumes TABLE has `org' as its `:type' 
property and
                   (concat caption "\\\\\n"))
              "\\end{longtabu}\n"
              (and fontsize "}")))
+     ;; Ltablex (Tabularx without float).
+     ((equal "ltablex" table-env)
+      (concat (and fontsize (concat "{" fontsize))
+             (format "\\begin{tabularx}{%s}{%s}\n"
+                     width
+                     alignment)
+             (and org-latex-table-caption-above
+                  (org-string-nw-p caption)
+                  (concat caption "\\\\\n"))
+             contents
+             (and (not org-latex-table-caption-above)
+                  (org-string-nw-p caption)
+                  (concat caption "\\\\\n"))
+             "\\end{tabularx}\n"
+             (and fontsize "}")))
      ;; Others.
      (t (concat (cond
                 (float-env
--
1.7.9



reply via email to

[Prev in Thread] Current Thread [Next in Thread]