emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Thomas S. Dye" <tsd@tsdye.com>
To: Org-mode ml <emacs-orgmode@gnu.org>
Subject: [PATCH] Optional caption argument
Date: Tue, 22 Feb 2011 06:57:03 -1000	[thread overview]
Message-ID: <94FA2DD7-B7AB-4140-AA14-3BC5F8EFE6E1@tsdye.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 367 bytes --]

Aloha all,

The attached patches activate some dormant code that handles an  
optional argument to #+CAPTION:.  An example of use is also added to  
org.texi.

With these patches, Org-mode now recognizes a caption of the form:

#+CAPTION: [Short caption for list of figures]{Long caption for table  
(or link).}

and exports it properly to LaTeX.

All the best,
Tom


[-- Attachment #2: 0001-lisp-org-latex.el-Enable-optional-argument-to-LaTeX-.patch --]
[-- Type: application/octet-stream, Size: 977 bytes --]

From 860b3e5a1b1189e800c3b295dea0bc3ff27c9bf8 Mon Sep 17 00:00:00 2001
From: Tom Dye <tsd@tsdye.com>
Date: Thu, 17 Feb 2011 06:29:03 -1000
Subject: [PATCH 1/3] * lisp/org-latex.el: Enable optional argument to LaTeX caption command

---
 lisp/org-latex.el |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index c558043..efc6f95 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -2196,12 +2196,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


[-- Attachment #3: 0002-lisp-org-exp.el-Set-shortn-nil-before-parsing-a-capt.patch --]
[-- Type: application/octet-stream, Size: 802 bytes --]

From ccf83187afe11175ed60911e657945d29a7b989c Mon Sep 17 00:00:00 2001
From: Tom Dye <tsd@tsdye.com>
Date: Thu, 17 Feb 2011 15:23:29 -1000
Subject: [PATCH 2/3] * lisp/org-exp.el: Set shortn nil before parsing a caption

---
 lisp/org-exp.el |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index 0e525e1..9f0e378 100644
--- a/lisp/org-exp.el
+++ b/lisp/org-exp.el
@@ -1721,6 +1721,7 @@ table line.  If it is a link, add it to the line containing the link."
        ;; there is a caption
        ((match-end 1)
 	(progn
+	  (setq shortn nil)
 	  (setq cap (concat cap (if cap " " "") (org-trim (match-string 1))))
 	  (when (string-match "\\[\\(.*\\)\\]{\\(.*\\)}" cap)
 	    (setq shortn (match-string 1 cap)
-- 
1.7.1


[-- Attachment #4: 0003-doc-org.texi-Added-example-of-short-caption-use.patch --]
[-- Type: application/octet-stream, Size: 875 bytes --]

From 736638b0e7bd522989125f10fca8c0184770d895 Mon Sep 17 00:00:00 2001
From: Tom Dye <tsd@tsdye.com>
Date: Tue, 22 Feb 2011 06:47:38 -1000
Subject: [PATCH 3/3] * doc/org.texi: Added example of short caption use.

---
 doc/org.texi |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/doc/org.texi b/doc/org.texi
index c8e0597..7fc886e 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -8735,6 +8735,11 @@ 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
-- 
1.7.1


[-- Attachment #5: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

                 reply	other threads:[~2011-02-22 16:57 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=94FA2DD7-B7AB-4140-AA14-3BC5F8EFE6E1@tsdye.com \
    --to=tsd@tsdye.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).