From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: latex export of org-mode: verbatim block in a figure Date: Fri, 15 Mar 2013 20:45:32 +0100 Message-ID: <87fvzw5twj.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:57556) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGaZU-00042K-OF for emacs-orgmode@gnu.org; Fri, 15 Mar 2013 15:45:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UGaZS-0000o0-I2 for emacs-orgmode@gnu.org; Fri, 15 Mar 2013 15:45:44 -0400 Received: from mail-wg0-f43.google.com ([74.125.82.43]:42348) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UGaZS-0000no-BQ for emacs-orgmode@gnu.org; Fri, 15 Mar 2013 15:45:42 -0400 Received: by mail-wg0-f43.google.com with SMTP id e12so3070471wge.10 for ; Fri, 15 Mar 2013 12:45:41 -0700 (PDT) In-Reply-To: (Rob Stewart's message of "Thu, 14 Mar 2013 15:33:50 +0000") 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: Rob Stewart Cc: emacs-orgmode@gnu.org Hello, Rob Stewart writes: > What I would like to do is simple: wrap a verbatim code block within a > Figure, so that I can refer to it elsewhere in my org-mode file. How > is this achieved? A naive solution, which does not work, looks like: > > #+CAPTION: My caption > #+LABEL: fig:my-api > #+ATTR_LaTeX: width=130mm,height=30mm > #+BEGIN_SRC haskell > foo :: Int -> String > bar :: String -> Int > #+END_SRC > > How would I achieve this? Could you elaborate the "which does not work" part? The following Org code: #+CAPTION: My caption #+NAME: fig:my-api #+BEGIN_SRC haskell foo :: Int -> String bar :: String -> Int #+END_SRC gives: \begin{figure}[H] \caption{\label{fig:my-api}My caption} \begin{verbatim} foo :: Int -> String bar :: String -> Int \end{verbatim} \end{figure} provided `org-latex-listings' is nil. Regards, -- Nicolas Goaziou