From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: [PATCH] Add \endifrsthead to longtable export Date: Sat, 26 Oct 2013 14:07:01 -1000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51561) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VaDsu-0002m3-5C for emacs-orgmode@gnu.org; Sat, 26 Oct 2013 20:07:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VaDsn-0000Px-6d for emacs-orgmode@gnu.org; Sat, 26 Oct 2013 20:07:12 -0400 Received: from oproxy19-pub.mail.unifiedlayer.com ([70.40.200.33]:32841) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1VaDsm-0000Pp-V7 for emacs-orgmode@gnu.org; Sat, 26 Oct 2013 20:07:05 -0400 Received: from [98.155.255.145] (port=49940 helo=poto.local) by box472.bluehost.com with esmtpsa (TLSv1:CAMELLIA128-SHA:128) (Exim 4.80) (envelope-from ) id 1VaDsk-00053V-BH for emacs-orgmode@gnu.org; Sat, 26 Oct 2013 18:07:02 -0600 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org-mode --=-=-= Content-Type: text/plain Aloha all, Previously, export of LaTeX longtables that spanned a page break generated a caption on each page, resulting in multiple entries in the table of contents. The attached patch for ox-latex.el 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". All the best, Tom --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-endfirsthead-to-longtable-export.patch Content-Description: Patch for ox-latex.el >From 1e205d7e2a5913580934ddee5285cc8ab0ff6f35 Mon Sep 17 00:00:00 2001 From: Thomas Dye Date: Sat, 26 Oct 2013 13:52:05 -1000 Subject: [PATCH] Add \endfirsthead to longtable export --- lisp/ox-latex.el | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index aa1a36c..6426d55 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -2624,11 +2624,24 @@ a communication channel." ;; 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 -- 1.8.3.3 --=-=-= Content-Type: text/plain -- T.S. Dye & Colleagues, Archaeologists 735 Bishop St, Suite 315, Honolulu, HI 96813 Tel: 808-529-0866, Fax: 808-529-0884 http://www.tsdye.com --=-=-=--