From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thomas S. Dye" Subject: Re: org-caption-shortn Date: Thu, 17 Feb 2011 06:42:10 -1000 Message-ID: <6E184DC8-D9D2-4A1F-9D1B-77F0FE5AE4F6@tsdye.com> References: <461D5ABC-6BC6-4A8E-9BC1-218F64EE97C6@tsdye.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: multipart/mixed; boundary=Apple-Mail-14--321332492 Return-path: Received: from [140.186.70.92] (port=53200 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pq6vr-0001WQ-Oc for emacs-orgmode@gnu.org; Thu, 17 Feb 2011 11:42:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pq6vq-0004ak-5V for emacs-orgmode@gnu.org; Thu, 17 Feb 2011 11:42:19 -0500 Received: from cpoproxy1-pub.bluehost.com ([69.89.21.11]:60843) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1Pq6vp-0004aF-TZ for emacs-orgmode@gnu.org; Thu, 17 Feb 2011 11:42:18 -0500 In-Reply-To: <461D5ABC-6BC6-4A8E-9BC1-218F64EE97C6@tsdye.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Thomas S. Dye" Cc: Org Mode --Apple-Mail-14--321332492 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit 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 --Apple-Mail-14--321332492 Content-Disposition: attachment; filename=0001-lisp-org-latex.el-Enable-optional-argument-to-LaTeX-.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-lisp-org-latex.el-Enable-optional-argument-to-LaTeX-.patch" Content-Transfer-Encoding: quoted-printable =46rom=20860b3e5a1b1189e800c3b295dea0bc3ff27c9bf8=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Tom=20Dye=20=0ADate:=20Thu,=20= 17=20Feb=202011=2006:29:03=20-1000=0ASubject:=20[PATCH]=20*=20= lisp/org-latex.el:=20Enable=20optional=20argument=20to=20LaTeX=20caption=20= command=0A=0A---=0A=20lisp/org-latex.el=20|=20=20=20=204=20++--=0A=201=20= files=20changed,=202=20insertions(+),=202=20deletions(-)=0A=0Adiff=20= --git=20a/lisp/org-latex.el=20b/lisp/org-latex.el=0Aindex=20= c558043..efc6f95=20100644=0A---=20a/lisp/org-latex.el=0A+++=20= b/lisp/org-latex.el=0A@@=20-2196,12=20+2196,12=20@@=20The=20conversion=20= is=20made=20depending=20of=20STRING-BEFORE=20and=20STRING-AFTER."=0A=20=09= =20=20=20(multicolumnp=20"\\begin{figure*}%placement=0A=20\\centering=0A=20= \\includegraphics[%attr]{%path}=0A-\\caption{%labelcmd%caption}=0A= +\\caption%shortn{%labelcmd%caption}=0A=20\\end{figure*}")=0A=20=09=20=20= =20(floatp=20"\\begin{figure}%placement=0A=20\\centering=0A=20= \\includegraphics[%attr]{%path}=0A-\\caption{%labelcmd%caption}=0A= +\\caption%shortn{%labelcmd%caption}=0A=20\\end{figure}")=0A=20=09=20=20=20= (t=20"\\includegraphics[%attr]{%path}")))=0A=20=0A--=20=0A1.7.1=0A=0A= --Apple-Mail-14--321332492 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit 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. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode --Apple-Mail-14--321332492 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --Apple-Mail-14--321332492--