Add new user option table-latex-environment

* lisp/textmodes/table.el (table-latex-environment): New user
option (bug#55333).
(table--generate-source-prologue): Use it.
This commit is contained in:
Vladimir Nikishkin 2022-05-09 12:03:33 +02:00 committed by Lars Ingebrigtsen
parent 52a27a67c1
commit 6b6b2c11ed
2 changed files with 19 additions and 2 deletions

View file

@ -2135,6 +2135,12 @@ This holds the value of the previous call to 'set-locale-environment'.
This macro can be used to change the locale temporarily while
executing code.
** table.el
---
*** New user option 'table-latex-environment'.
This allows switching between "table" and "tabular".
** Tabulated List Mode
+++

View file

@ -753,6 +753,16 @@ the cell contents dynamically."
:type 'string
:group 'table)
(defcustom table-latex-environment "tabular"
"Which tabular-compatible environment to use when generating latex.
\"tabular\" and \"longtable\" are known to work."
:tag "Latex environment used to export tables"
:type '(choice
(const :tag "tabular" "tabular")
(const :tag "longtable" "longtable")
string)
:version "29.1")
(defcustom table-cals-thead-rows 1
"Number of top rows to become header rows in CALS table."
:tag "CALS Header Rows"
@ -3025,7 +3035,8 @@ CALS (DocBook DTD):
"")))
((eq language 'latex)
(insert (format "%% This LaTeX table template is generated by emacs %s\n" emacs-version)
"\\begin{tabular}{|" (apply #'concat (make-list (length col-list) "l|")) "}\n"
"\\begin{" table-latex-environment "}{|"
(apply #'concat (make-list (length col-list) "l|")) "}\n"
"\\hline\n"))
((eq language 'cals)
(insert (format "<!-- This CALS table template is generated by emacs %s -->\n" emacs-version)
@ -3051,7 +3062,7 @@ CALS (DocBook DTD):
((eq language 'html)
(insert "</table>\n"))
((eq language 'latex)
(insert "\\end{tabular}\n"))
(insert "\\end{" table-latex-environment "}\n"))
((eq language 'cals)
(set-marker-insertion-type (table-get-source-info 'colspec-marker) t) ;; insert before
(save-excursion