emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Rob Stewart <robstewart57@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: latex export of org-mode: verbatim block in a figure
Date: Fri, 15 Mar 2013 20:45:32 +0100	[thread overview]
Message-ID: <87fvzw5twj.fsf@gmail.com> (raw)
In-Reply-To: <CA+ZOasJxqohP4L_MzmmQ4vr7p4W=4U=YZtwa85RNMk1=wVFP2A@mail.gmail.com> (Rob Stewart's message of "Thu, 14 Mar 2013 15:33:50 +0000")

Hello,

Rob Stewart <robstewart57@gmail.com> 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

  parent reply	other threads:[~2013-03-15 19:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-14 15:33 latex export of org-mode: verbatim block in a figure Rob Stewart
2013-03-15 10:03 ` AW
2013-03-15 19:45 ` Nicolas Goaziou [this message]
  -- strict thread matches above, loose matches on Subject: below --
2013-03-15 11:50 Rob Stewart
2013-03-15 16:21 ` Thomas S. Dye

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fvzw5twj.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=robstewart57@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).