From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: src blocks, listings package and captions Date: Thu, 25 Aug 2011 09:11:06 -0600 Message-ID: <87wre1ikvd.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:60584) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qwbdf-0008Ty-68 for emacs-orgmode@gnu.org; Thu, 25 Aug 2011 11:14:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qwbdd-000450-W3 for emacs-orgmode@gnu.org; Thu, 25 Aug 2011 11:14:39 -0400 Received: from mail-qw0-f41.google.com ([209.85.216.41]:45906) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qwbdd-00044u-Tq for emacs-orgmode@gnu.org; Thu, 25 Aug 2011 11:14:37 -0400 Received: by qwd6 with SMTP id 6so1699539qwd.0 for ; Thu, 25 Aug 2011 08:14:36 -0700 (PDT) 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 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? Currently code blocks are not wrapped in begin/end{figure} environments as are links and tables. I do not know of an easy way to do this aside from manually inserting the LaTeX using #+LaTeX: lines in the Org-mode file. I personally would like to treat code blocks in the same way as links and tables, but I'm not sure if there is a specific reason we do not do this currently. Thanks -- Eric -- Eric Schulte http://cs.unm.edu/~eschulte/