From mboxrd@z Thu Jan 1 00:00:00 1970 From: Francesco Pizzolante Subject: [PATCH] Add support for `ltablex' Date: Tue, 03 Sep 2013 16:52:40 +0200 Message-ID: <87r4d654dn.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: mailing-list-org-mode 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 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