* latex export of org-mode: verbatim block in a figure
@ 2013-03-14 15:33 Rob Stewart
2013-03-15 10:03 ` AW
2013-03-15 19:45 ` Nicolas Goaziou
0 siblings, 2 replies; 5+ messages in thread
From: Rob Stewart @ 2013-03-14 15:33 UTC (permalink / raw)
To: emacs-orgmode
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?
--
Rob
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: latex export of org-mode: verbatim block in a figure
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
1 sibling, 0 replies; 5+ messages in thread
From: AW @ 2013-03-15 10:03 UTC (permalink / raw)
To: emacs-orgmode
Am Donnerstag, 14. März 2013, 15:33:50 schrieb Rob Stewart:
> 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?
>
> --
> Rob
There are some things I don't quite understand: Would you like to export to
LaTeX, or would you simply like to have a <<target>> to refer to in an orgmode
file?
And why have a figure, instead of -- in LaTeX terminology -- a listing?
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: latex export of org-mode: verbatim block in a figure
@ 2013-03-15 11:50 Rob Stewart
2013-03-15 16:21 ` Thomas S. Dye
0 siblings, 1 reply; 5+ messages in thread
From: Rob Stewart @ 2013-03-15 11:50 UTC (permalink / raw)
To: emacs-orgmode
> There are some things I don't quite understand: Would you like to export to
> LaTeX, or would you simply like to have a <<target>> to refer to in an orgmode
> file?
I'd like. in my orgmode file, to be able to say, "see Figure
\ref{fig:my-api}". When I export to LaTeX, I'd like it to then
correctly export the reference as it would be in LaTeX e.g. if the
Figure is 1.1, then then pdflatex would produce: "see Figure 1.1".
> And why have a figure, instead of -- in LaTeX terminology -- a listing?
Good point. Yes, Listing would be good. Any idea how to solve this
reference problem as a listing?
Thanks,
--
Rob
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: latex export of org-mode: verbatim block in a figure
2013-03-15 11:50 Rob Stewart
@ 2013-03-15 16:21 ` Thomas S. Dye
0 siblings, 0 replies; 5+ messages in thread
From: Thomas S. Dye @ 2013-03-15 16:21 UTC (permalink / raw)
To: Rob Stewart; +Cc: emacs-orgmode
Aloha Rob,
Rob Stewart <robstewart57@gmail.com> writes:
>> There are some things I don't quite understand: Would you like to export to
>> LaTeX, or would you simply like to have a <<target>> to refer to in an orgmode
>> file?
>
> I'd like. in my orgmode file, to be able to say, "see Figure
> \ref{fig:my-api}". When I export to LaTeX, I'd like it to then
> correctly export the reference as it would be in LaTeX e.g. if the
> Figure is 1.1, then then pdflatex would produce: "see Figure 1.1".
>
>> And why have a figure, instead of -- in LaTeX terminology -- a listing?
>
> Good point. Yes, Listing would be good. Any idea how to solve this
> reference problem as a listing?
The LaTeX minted package has a facility for "floated listings" that
might do what you want.
hth,
Tom
--
Thomas S. Dye
http://www.tsdye.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: latex export of org-mode: verbatim block in a figure
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
1 sibling, 0 replies; 5+ messages in thread
From: Nicolas Goaziou @ 2013-03-15 19:45 UTC (permalink / raw)
To: Rob Stewart; +Cc: emacs-orgmode
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-03-15 19:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
-- strict thread matches above, loose matches on Subject: below --
2013-03-15 11:50 Rob Stewart
2013-03-15 16:21 ` Thomas S. Dye
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.