>From aba08346276e558fd7f6aa635e6f1e5081a2d3c3 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Tue, 29 Nov 2011 17:30:14 +0000 Subject: [PATCH] hfmt table attribute in LaTeX export * org-latex.el (org-export-latex-tables): - new word-match and attr-match local macros to reduce boilerplate. (This is a tiny, mechanical change) - support hfmt LaTeX_ATTR attribute, and if given pass it through to orgtbl-to-latex. (This is a tiny change) --- lisp/org-latex.el | 28 ++++++++++++++-------------- 1 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lisp/org-latex.el b/lisp/org-latex.el index 2ec347a..aebfda5 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -1891,7 +1891,10 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." "\\end{verbatim}\n"))) (apply 'delete-region (list beg end)) (insert (org-export-latex-protect-string tbl))) - (progn + (macrolet ((word-match (string haystack) + `(string-match ,(format "\\(?:\\`\\|\\s-\\)%s\\(?:\\'\\|\\s-\\)" string) ,haystack)) + (attr-match (string) + `(and attr (stringp attr) (word-match ,string attr)))) (setq caption (org-find-text-property-in-string 'org-caption raw-table) shortn (org-find-text-property-in-string @@ -1901,26 +1904,22 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." label (org-find-text-property-in-string 'org-label raw-table) longtblp (and attr (stringp attr) - (string-match "\\" attr)) - tblenv (if (and attr (stringp attr) - (or (string-match (regexp-quote "table*") attr) - (string-match "\\" attr))) + (word-match "longtable" attr)) + tblenv (if (or (attr-match (regexp-quote "table*")) + (attr-match "multicolumn")) "table*" "table") tabular-env - (if (and attr (stringp attr) - (string-match "\\(tabular.\\)" attr)) + (if (attr-match "\\(tabular.\\)") (match-string 1 attr) org-export-latex-tabular-environment) - width (and attr (stringp attr) - (string-match "\\