From 9b51d999029f91adc93a6009bc3ddf56bba7ba4a Mon Sep 17 00:00:00 2001 From: Juan Manuel Macias Date: Tue, 26 Oct 2021 12:29:55 +0200 Subject: [PATCH] ox-latex.el: add `options' latex attribute to tables * lisp/ox-latex.el (org-latex--org-table): The `:options' LaTeX attribute allows adding an optional argument (\begin{env}[opt]), since certain tabular environments, such as longtblr, accept optional arguments. --- lisp/ox-latex.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 3e3967033..409d92164 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -3314,6 +3314,7 @@ This function assumes TABLE has `org' as its `:type' property and `table' as its `:mode' attribute." (let* ((attr (org-export-read-attribute :attr_latex table)) (alignment (org-latex--align-string table info)) + (opt (org-export-read-attribute :attr_latex table :options)) (table-env (or (plist-get attr :environment) (plist-get info :latex-default-table-environment))) (width @@ -3343,8 +3344,9 @@ This function assumes TABLE has `org' as its `:type' property and (format "\\end{%s}" table-env) (and fontsize "}")))) (t - (let ((output (format "\\begin{%s}%s{%s}\n%s\\end{%s}" + (let ((output (format "\\begin{%s}%s%s{%s}\n%s\\end{%s}" table-env + (if opt (format "[%s]" opt) "") width alignment contents -- 2.33.0