From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bastien Subject: Re: src blocks, listings package and captions Date: Thu, 25 Aug 2011 09:50:47 +0200 Message-ID: <87ei0ac4ko.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:34554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwUhV-0001kr-Sv for emacs-orgmode@gnu.org; Thu, 25 Aug 2011 03:50:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QwUhU-00016Z-KC for emacs-orgmode@gnu.org; Thu, 25 Aug 2011 03:50:09 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:62567) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwUhU-00016F-Az for emacs-orgmode@gnu.org; Thu, 25 Aug 2011 03:50:08 -0400 Received: by wyi11 with SMTP id 11so1681181wyi.0 for ; Thu, 25 Aug 2011 00:50:07 -0700 (PDT) In-Reply-To: (Giles Chamberlin's message of "Wed, 24 Aug 2011 16:58:35 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Giles Chamberlin Cc: emacs-orgmode@gnu.org Hi Giles, Giles Chamberlin writes: > I'm using the listings package and org-version 7.4 to generate latex/pdf > output including source snippets. I'd like to add captions: "Figure 1: > My code" and tried with the following to no avail: > > #+caption: My code > #+begin_src clojure > ;; stuff > #+end_src > > Do I have to wrap this in \begin{figure}\caption{} or is there a simpler > way? Since captions make sense for figures, I think you have to wrap this in \begin{figure}\caption{}. But maybe there is a way to automatically wrap source blocks into a caption-aware LaTeX environment -- Eric might give a more useful answer. Thanks, -- Bastien