emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] org-caption-shortn


From: Thomas S. Dye
Subject: Re: [Orgmode] org-caption-shortn
Date: Thu, 17 Feb 2011 06:42:10 -1000

Aloha all,

First, apologies for my rudimentary programming skills. The attached patch partially answers the query I posed earlier: the shortn argument was ignored except for the wrapfigure environment. The attached patch makes other environments aware of shortn.

This works, sort of. If all the #+CAPTION: lines are of this form # +CAPTION: [shortn]{caption}, then all goes well. If one caption of this form is followed by others of this form #+CAPTION: caption, then the list of figures contains repeated entries of shortn. I suspect there is code somewhere that clears a variable. I can try to look for it, but I have to tell you that the lisp code to org-mode looks like magic spells to my untrained eye.

All the best,
Tom

Attachment: 0001-lisp-org-latex.el-Enable-optional-argument-to-LaTeX-.patch
Description: Binary data




On Feb 16, 2011, at 6:23 PM, Thomas S. Dye wrote:

Aloha all,

I stumbled across code in org-exp.el and org-latex.el that appears to my untrained eye to be designed to parse the optional argument to the LaTeX \caption command.

This bit in org-exp.el appears to parse out the optional command:

          (when (string-match "\\[\\(.*\\)\\]{\\(.*\\)}" cap)
            (setq shortn (match-string 1 cap)
                  cap (match-string 2 cap)))

Then it is easy to find code in org-latex.el by searching for 'shortn' that looks like it writes out the full command to the .tex file.

I can't find documentation for this, though. It looks (to my untrained eye) like it should be possible to write something like:

#+CAPTION: [short]{long}

and get

\caption[short]{long} in the .tex file.

But this doesn't work for me. The [short] part doesn't make it into the .tex file.

I don't know enough lisp to figure this out in a reasonable amount of time, so have come to the list to ask if anyone familiar with the code knows whether this should work or not, and if it should work, how to markup the org file.

All the best,
Tom

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]