From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: [PATCH] Optional \caption argument for LaTeX export Date: Sun, 08 May 2011 13:22:39 -1000 Message-ID: References: <878vugev4k.fsf@norang.ca> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:54853) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJDJH-0004j4-Tx for emacs-orgmode@gnu.org; Sun, 08 May 2011 19:22:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QJDJG-0004H4-HN for emacs-orgmode@gnu.org; Sun, 08 May 2011 19:22:47 -0400 Received: from oproxy8-pub.bluehost.com ([69.89.22.20]:40724) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1QJDJG-0004Gh-4c for emacs-orgmode@gnu.org; Sun, 08 May 2011 19:22:46 -0400 In-Reply-To: <878vugev4k.fsf@norang.ca> (Bernt Hansen's message of "Sun, 08 May 2011 17:32:27 -0400") 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: Bernt Hansen Cc: emacs-orgmode@gnu.org --=-=-= Bernt Hansen writes: > tsd@tsdye.com (Thomas S. Dye) writes: > >> With this patch, #+CAPTION: [Short caption]{Long caption.} in the >> Org-mode source exports to \caption[Short caption]{Long caption.} in the >> LaTeX export, which is, I think, as it should be. > > Hi Thomas, > > Thanks for the patch! > > Please add the above details (without the 'With this patch' and ', which > is, I think, as it should be') to body of the commit message (starting > on line 3). This makes it possible to read just the commit log message > 6 months from now and know what the patch is about without the necessity > of reading the code changes. > > Regards, > Bernt > 6 months ... yikes! I think this is what you're asking for. Let me know if it falls short. All the best, Tom --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Activate-optional-argument-to-LaTeX-caption-command.patch Content-Description: Optional caption command patch >From 37eba27e80a84175e09b01e7125269154c40396d Mon Sep 17 00:00:00 2001 From: Tom Dye Date: Sun, 8 May 2011 13:16:15 -1000 Subject: [PATCH] Activate optional argument to LaTeX caption command. CAPTION: [Short caption]{Long caption.} in the Org-mode source exports to \caption[Short caption]{Long caption.} in theLaTeX export. --- doc/org.texi | 6 ++++++ lisp/org-exp.el | 2 +- lisp/org-latex.el | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/doc/org.texi b/doc/org.texi index 844de6d..8058288 100644 --- a/doc/org.texi +++ b/doc/org.texi @@ -8817,6 +8817,12 @@ the object with @code{\ref@{tab:basic-data@}}: |-----|----| @end example +Optionally, the caption can take the form: +@example +#+CAPTION: [Caption for list of figures]{Caption for table (or link).} +@end example + + @cindex inlined images, markup rules Some backends (HTML, @LaTeX{}, and DocBook) allow you to directly include images into the exported document. Org does this, if a link to an image diff --git a/lisp/org-exp.el b/lisp/org-exp.el index cda1f98..e840b6c 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -1871,7 +1871,7 @@ table line. If it is a link, add it to the line containing the link." 'org-label label)) (if label (push (cons label label) target-alist)) (goto-char end) - (setq cap nil attr nil label nil))))) + (setq cap nil shortn nil attr nil label nil))))) target-alist) (defun org-export-remove-comment-blocks-and-subtrees () diff --git a/lisp/org-latex.el b/lisp/org-latex.el index bc9a3f3..516ee12 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -2199,12 +2199,12 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." (multicolumnp "\\begin{figure*}%placement \\centering \\includegraphics[%attr]{%path} -\\caption{%labelcmd%caption} +\\caption%shortn{%labelcmd%caption} \\end{figure*}") (floatp "\\begin{figure}%placement \\centering \\includegraphics[%attr]{%path} -\\caption{%labelcmd%caption} +\\caption%shortn{%labelcmd%caption} \\end{figure}") (t "\\includegraphics[%attr]{%path}"))) -- 1.7.1 --=-=-= -- 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 --=-=-=--