From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: [PATCH] Re: Latex Export: Place Caption Below Table Date: Sun, 09 Oct 2011 13:24:50 -1000 Message-ID: References: <87zkhor9hb.fsf@ucl.ac.uk> <17486.1317238846@alphaville.dokosmarshall.org> <878vp2fqch.fsf@ucl.ac.uk> <701.1317652994@alphaville.dokosmarshall.org> <12B289CE-8698-4728-9911-EF945AB39D71@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:47317) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RD2js-0005um-9X for emacs-orgmode@gnu.org; Sun, 09 Oct 2011 19:25:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RD2jq-0003Bp-Ay for emacs-orgmode@gnu.org; Sun, 09 Oct 2011 19:25:00 -0400 Received: from oproxy4-pub.bluehost.com ([69.89.21.11]:44981) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RD2jq-0003Bb-1K for emacs-orgmode@gnu.org; Sun, 09 Oct 2011 19:24:58 -0400 In-Reply-To: <12B289CE-8698-4728-9911-EF945AB39D71@gmail.com> (Carsten Dominik's message of "Sun, 9 Oct 2011 13:23:06 +0200") 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: Carsten Dominik Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org, Jakob Lombacher --=-=-= Carsten Dominik writes: > On 3.10.2011, at 16:43, Nick Dokos wrote: > >> Eric S Fraga wrote: >> >>> tsd@tsdye.com (Thomas S. Dye) writes: >>> >>>> Nick Dokos writes: >>> >>>>> The following patch (deliberately hidden as a binary octet-stream to keep it >>>>> out of patchwork) will do that - but IMO, it would be better to have yet another >>>>> user-settable option to control the placement. >>>>> >>>>> Nick >>>>> >>>>> >>>> >>>> Aloha all, >>>> >>>> The inlined patch introduces a variable >>>> org-export-latex-table-caption-above to control the placement of table >>>> captions. Thanks to Nick Dokos for leading the way on this. >>>> >>>> Tom >>> >>> >>> thanks for doing this -- I was swamped last week so had no chance of >>> following the thread until today! >>> >>> One comment on the last version of the patch: would it not be better for >>> the variable to be a defcustom variable instead of defvar? >> >> I agree - being able to customize variables without resorting to lisp is >> generally preferable: it is friendlier to newcomers and it allows even >> experienced users to find the various knobs. > > If you provide a new patch doing a defcustom, I think this patch would be > good to have. Please go ahead and check it in! > > - Carsten > Aloha Carsten, The inlined patch changes the defvar to a defcustom. It is meant to be applied after the first patch. All the best, Tom --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0002-LaTeX-export-Add-switch-to-place-captions-above-or-b.patch Content-Description: Patch 2 of 2 >From af153cdaa827903e4ada316b99adef25a735ada7 Mon Sep 17 00:00:00 2001 From: Tom Dye Date: Sun, 9 Oct 2011 13:09:02 -1000 Subject: [PATCH 2/2] LaTeX export: Add switch to place captions above or below tables * lisp/org-latex.el (org-export-latex-tables): Add new variable org-export-latex-table-caption-above Modified from an idea suggested by Eric Fraga and fleshed out by Nick Dokos. --- lisp/org-latex.el | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/lisp/org-latex.el b/lisp/org-latex.el index f91b93e..7957ffe 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -73,7 +73,6 @@ org-deadline-string "\\|" org-closed-string"\\)") "Regexp matching special time planning keywords plus the time after it.") -(defvar org-export-latex-table-caption-above t) (defvar org-re-quote) ; dynamically scoped from org.el (defvar org-commentsp) ; dynamically scoped from org.el @@ -364,6 +363,12 @@ When nil, grouping causes only separation lines between groups." :group 'org-export-latex :type 'boolean) +(defcustom org-export-latex-table-caption-above t + "When non-nil, the caption is set above the table. When nil, +the caption is set below the table." + :group 'org-export-latex + :type 'boolean) + (defcustom org-export-latex-low-levels 'itemize "How to convert sections below the current level of sectioning. This is specified by the `org-export-headline-levels' option or the -- 1.7.1 --=-=-= >> >> If the patch is deemed acceptable, it might also be nice to be able to >> set the variable per-file through the OPTIONS line, but that can >> certainly wait. >> >>> Otherwise, >>> the patch looks fine to me although I'm unlikely to use the new >>> functionality ;-) >> >> Unless you try to publish an article in a journal with a perverse layout >> policy :-) >> >> I applied the patch and took it for a short spin. git complained about >> trailing whitespace: >> >> ,---- >> | /home/nick/Mail/inbox/1021:197: trailing whitespace. >> | (if (and floatp org-export-latex-table-caption-above) >> | /home/nick/Mail/inbox/1021:212: trailing whitespace. >> | (if (and floatp (not org-export-latex-table-caption-above)) >> | /home/nick/Mail/inbox/1021:225: trailing whitespace. >> | (if (not org-export-latex-table-caption-above) tbl) >> | /home/nick/Mail/inbox/1021:231: trailing whitespace. >> | (if org-export-latex-table-caption-above tbl) >> | warning: 4 lines add whitespace errors. >> `---- >> >> but other than that the patch worked fine. >> >> Thanks, Tom! >> Nick >> >> >> > > > -- Thomas S. Dye http://www.tsdye.com --=-=-=--