From e36139ea026f923769bf669604ef14a247cd5b76 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 26 May 2015 09:52:02 +0200 Subject: [PATCH] ox-texinfo: Handle tables with captions and list of tables * lisp/ox-texinfo.el (org-texinfo-table): Wrap captionned tables within a @float command. (org-texinfo-keyword): Handle "#+TOC: tables". --- lisp/ox-texinfo.el | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el index 10776ac81..d52fd7317 100644 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@ -928,7 +928,11 @@ CONTENTS is nil. INFO is a plist holding contextual information." ((string= key "KINDEX") (format "@kindex %s" value)) ((string= key "PINDEX") (format "@pindex %s" value)) ((string= key "TINDEX") (format "@tindex %s" value)) - ((string= key "VINDEX") (format "@vindex %s" value))))) + ((string= key "VINDEX") (format "@vindex %s" value)) + ((string= key "TOC") + (cond ((org-string-match-p "\\" value) + (concat "@listoffloats " + (org-export-translate "Table" :utf-8 info)))))))) ;;;; Line Break @@ -1343,10 +1347,19 @@ contextual information." (let* ((col-width (org-export-read-attribute :attr_texinfo table :columns)) (columns (if col-width (format "@columnfractions %s" col-width) - (org-texinfo-table-column-widths table info)))) - (format "@multitable %s\n%s@end multitable" - columns - contents)))) + (org-texinfo-table-column-widths table info))) + (caption (org-export-get-caption table)) + (shortcaption (org-export-get-caption table t)) + (table-str (format "@multitable %s\n%s@end multitable" + columns + contents))) + (if (not (or caption shortcaption)) table-str + (org-texinfo--wrap-float table-str + info + (org-export-translate "Table" :utf-8 info) + (org-element-property :name table) + caption + shortcaption))))) (defun org-texinfo-table-column-widths (table info) "Determine the largest table cell in each column to process alignment. -- 2.11.4.GIT