emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Optional caption argument
@ 2011-02-22 16:57 Thomas S. Dye
  0 siblings, 0 replies; only message in thread
From: Thomas S. Dye @ 2011-02-22 16:57 UTC (permalink / raw)
  To: Org-mode ml

[-- 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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-02-22 16:57 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-22 16:57 [PATCH] Optional caption argument Thomas S. Dye

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).