From 3c4afa706d79c1895162ee25765b7a711d58fcd9 Mon Sep 17 00:00:00 2001 From: Thomas Dye Date: Sat, 26 Oct 2013 13:52:05 -1000 Subject: [PATCH] ox-latex: Add \endfirsthead to longtable export * lisp/ox-latex.el (org-latex-table-row): Implements the \endfirsthead command so the caption only appears once, at the top of the table. Subsequent pages of the table start with "Continued from previous page". --- lisp/ox-latex.el | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index aa1a36c99..2639fabd6 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -2621,14 +2621,27 @@ a communication channel." ((and (memq 'top borders) (memq 'above borders)) "\\hline\n")) contents "\\\\\n" (cond - ;; Special case for long tables. Define header and footers. + ;; Special case for long tables. Define header and footers. ((and longtablep (org-export-table-row-ends-header-p table-row info)) (format "%s +\\endfirsthead +\\multicolumn{%d}{l}{Continued from previous page} \\\\ +%s +%s \\\\\n +%s \\endhead %s\\multicolumn{%d}{r}{Continued on next page} \\\\ \\endfoot \\endlastfoot" (if booktabsp "\\midrule" "\\hline") + (cdr (org-export-table-dimensions + (org-export-get-parent-table table-row) info)) + (cond ((and booktabsp (memq 'top borders)) "\\toprule\n") + ((and (memq 'top borders) + (memq 'above borders)) "\\hline\n") + (t "")) + contents + (if booktabsp "\\midrule" "\\hline") (if booktabsp "\\midrule" "\\hline") ;; Number of columns. (cdr (org-export-table-dimensions -- 2.11.4.GIT