From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Riedy Subject: [PATCH] Let orgtbl export the last table line with a different ending. Date: Thu, 28 Feb 2008 16:02:03 -0800 Message-ID: <87zltksk90.fsf@sparse.yi.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JUshh-0003LS-6G for emacs-orgmode@gnu.org; Thu, 28 Feb 2008 19:02:21 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JUshd-0003Fy-6n for emacs-orgmode@gnu.org; Thu, 28 Feb 2008 19:02:20 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JUshc-0003Fk-S4 for emacs-orgmode@gnu.org; Thu, 28 Feb 2008 19:02:16 -0500 Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JUshc-0007yl-9N for emacs-orgmode@gnu.org; Thu, 28 Feb 2008 19:02:16 -0500 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JUshY-00038O-5m for emacs-orgmode@gnu.org; Fri, 29 Feb 2008 00:02:12 +0000 Received: from 209-204-163-7.vpn.sonic.net ([209.204.163.7]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 29 Feb 2008 00:02:12 +0000 Received: from jason by 209-204-163-7.vpn.sonic.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 29 Feb 2008 00:02:12 +0000 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org If the last line ends with the default :lend in LaTeX (\\), a horizontal line placed after the table will have too much preceeding vertical space. Signed-off-by: Jason Riedy --- Yeah, this is the cheap version. The "better" version would break the loop into header and body pieces and allow a :hllend. But right now I'm splicing all my tables for other reasons. org.el | 7 ++++--- org.texi | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/org.el b/org.el index 476cee8..a4e0e43 100644 --- a/org.el +++ b/org.el @@ -11771,6 +11771,7 @@ Valid parameters are :lstart String to start a new table line. :lend String to end a table line +:llend String to end the last line of a table :sep Separator between two fields :lfmt Format for entire line, with enough %s to capture all fields. If this is present, :lstart, :lend, and :sep are ignored. @@ -11832,7 +11833,7 @@ directly by `orgtbl-send-table'. See manual." (push (concat (org-get-param p h i :lstart :hlstart) (mapconcat 'identity line (org-get-param p h i :sep :hsep)) - (org-get-param p h i :lend :hlend)) + (org-get-param p h i (if table :lend :llend) :hlend)) rtn)))) (unless splicep @@ -11869,7 +11870,7 @@ this function is called." (list :tstart (concat "\\begin{tabular}{" alignment "}") :tend "\\end{tabular}" - :lstart "" :lend " \\\\" :sep " & " + :lstart "" :lend " \\\\" :llend "" :sep " & " :efmt "%s\\,(%s)" :hline "\\hline"))) (orgtbl-to-generic table (org-combine-plists params2 params)))) @@ -11934,7 +11935,7 @@ this function is called." (list :tstart (concat "@multitable @columnfractions " colfrac) :tend "@end multitable" - :lstart "@item " :lend "" :sep " @tab " + :lstart "@item " :lend "" :llend "" :sep " @tab " :hlstart "@headitem "))) (orgtbl-to-generic table (org-combine-plists params2 params)))) diff --git a/org.texi b/org.texi index fab72ec..daad533 100644 --- a/org.texi +++ b/org.texi @@ -8228,7 +8228,7 @@ generic translator. Here is the entire code: (list :tstart (concat "\\begin@{tabular@}@{" alignment "@}") :tend "\\end@{tabular@}" - :lstart "" :lend " \\\\" :sep " & " + :lstart "" :lend " \\\\" :llend "" :sep " & " :efmt "%s\\,(%s)" :hline "\\hline"))) (orgtbl-to-generic table (org-combine-plists params2 params)))) @end group @@ -8256,7 +8256,8 @@ a single line!): @example #+ORGTBL: SEND test orgtbl-to-generic :tstart "!BTBL!" :tend "!ETBL!" - :lstart "!BL! " :lend " !EL!" :sep "\t" + :lstart "!BL! " :lend " !EL!" :llend " !EL!" + :sep "\t" @end example @noindent -- 1.5.4.3