emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] latex export of org-mode: verbatim block in a figure


From: Nicolas Goaziou
Subject: Re: [O] latex export of org-mode: verbatim block in a figure
Date: Fri, 15 Mar 2013 20:45:32 +0100

Hello,

Rob Stewart <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]