From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thomas S. Dye" Subject: Re: Captionshttp://adzes.tsdye2.com Source Code Date: Thu, 9 Dec 2010 15:22:47 -1000 Message-ID: References: <4D00106F.2020500@med.uni-goettingen.de> <4D01144D.7070608@med.uni-goettingen.de> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=41020 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQrhF-0003au-Ng for emacs-orgmode@gnu.org; Thu, 09 Dec 2010 20:22:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQrhE-0004IA-1z for emacs-orgmode@gnu.org; Thu, 09 Dec 2010 20:22:53 -0500 Received: from oproxy1-pub.bluehost.com ([66.147.249.253]:36899) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PQrhD-0004Hs-ME for emacs-orgmode@gnu.org; Thu, 09 Dec 2010 20:22:51 -0500 In-Reply-To: <4D01144D.7070608@med.uni-goettingen.de> 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: Andreas Leha Cc: emacs-orgmode@gnu.org Aloha Andreas, Good to hear it works for you. I don't believe there is currently a way to use #+CAPTION: with =20 anything other than links to images and with tables. The approach with org-special-blocks has the advantage that it will =20 work with the minted package as well as the listings package, in case =20= you decide to switch packages mid-stream. All the best, Tom On Dec 9, 2010, at 7:39 AM, Andreas Leha wrote: > Hi Tom, > > thanks for the answer. Works great. > > The lstlistings LaTeX package, however, has the advantage of providing > captions without a float environment - it has its own caption=3D = switch. > > So I hoped, that I could do just > #+source: identification-part > #+begin_src latex :exports code > \NeedsTeXFormat{LaTeX2e} > \ProvidesClass{org-article}[2010/11/25 0.3 (TSD)] > #+end_src > and the Org-Export-Latex-Listings-W-Names option (maybe in connection > with a header argument) would also produce a caption in the latex =20 > output. > But I could not find an option or header switch. So I guess it's just > not there... > > Cheers, > Andreas > > > > > > > > Am 09.12.2010 16:44, schrieb Thomas S. Dye: >> Aloha Andreas, >> >> Here's one way to get captions with source code listings and a list =20= >> of >> listings. >> >> Use org-special-blocks to export a listing environment, e.g. >> >> #+BEGIN_listing >> #+source: identification-part >> #+begin_src latex :exports code >> \NeedsTeXFormat{LaTeX2e} >> \ProvidesClass{org-article}[2010/11/25 0.3 (TSD)] >> #+end_src >> #+LATEX: \caption[The identification part of the class file]{The >> identification part of the class file.}\label{fig:identification-=20 >> part} >> #+END_listing >> >> The caption is in LaTeX here (which has the advantage of the optional >> argument). >> >> You'll need to define a listing float type for LaTeX. With the float >> package it might look like this: >> >> \newfloat{listing}{h}{lol} >> \newcommand\listingscaption{Listing} >> \floatname{listing}{\listingscaption} >> \newcommand\listoflistingscaption{List of Listings} >> \providecommand\listoflistings{\listof{listing}=20 >> {\listoflistingscaption}} >> \floatplacement{listing}{htb!} >> >> If you're using the KOMA scripts, which complain about the float >> package, something like this should work: >> >> \DeclareNewTOC[type=3Dlisting,name=3DListing,float,floatpos=3Dhtb!]{lol= } >> \newcommand\listoflistings{\listoftoc[List of Listings]{lol}} >> >> hth, >> Tom >> >> On Dec 8, 2010, at 1:10 PM, Andreas Leha wrote: >> >>> Hi all, >>> >>> has the feature of captions for source code blocks made any progress >>> (see http://thread.gmane.org/gmane.emacs.orgmode/27896/focus=3D27913)?= >>> >>> I am very interested in this feature for the latex listings package. >>> >>> Regards, >>> Andreas >>> >>> _______________________________________________ >>> 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 >> > > --=20 > Andreas Leha > > Universit=E4tsmedizin G=F6ttingen > Abteilung Medizinische Statistik > Humboldtallee 32 > 37073 G=F6ttingen > > Tel: +49 (0)551 39-10710 > Fax: +49 (0)551 39-4995 > > http://www.ams.med.uni-goettingen.de/amsneu/leha.html > > > > University Medical Center G=F6ttingen > Department for Medical Statistics > Humboldtallee 32 > 37073 G=F6ttingen > Germany > > Phone: +49 (0) 551 39-10710 > Fax: +49 (0) 551 39-4995 > > http://www.ams.med.uni-goettingen.de/amsneu/leha-en.html > > > _______________________________________________ > 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