all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Exporting source code blocks as LaTeX figures
@ 2013-05-17  7:14 James Harkins
  2013-05-18  7:39 ` Nicolas Goaziou
  0 siblings, 1 reply; 7+ messages in thread
From: James Harkins @ 2013-05-17  7:14 UTC (permalink / raw)
  To: Emacs-orgmode@gnu.org

Couple of questions about exporting LaTeX figures that are neither
tables nor images -- specifically, source code blocks using the
listings package.

1. Is there any way to use #+CAPTION with a #+BEGIN_figure block, so
that the caption will be rendered underneath the text in the figure?

It seems (from reading the org manual and some experimentation on my
own) that the answer is no. That's rather inconvenient; the journal
specifies that captions should appear below their respective figures,
but as it is:

#+CAPTION: Some code
#+NAME: code1
#+BEGIN_figure
#+BEGIN_SRC {}
// blah blah

-->

\begin{figure}
\caption{\label{code1}Some code}
\lstset{language={},numbers=none}
\begin{lstlisting}
// blah blah

-->

Figure 1. Some code.

// blah blah
.....

I can work around it by not using #+CAPTION, and writing
\caption{...}\label{...}. That shouldn't be a problem for this
project, unless for some reason I should have to re-export as, say,
ODT or HTML.

2. Is the customize variable "Org Latex Default Figure Position" only
used for tables and images? It would be nice if it applied to
BEGIN_figure as well (unless :options override that). "#+ATTR_LaTeX:
:options [htb]" is a mite inconvenient to replicate for every code
example. Certainly possible, but it would save a little effort if the
default were used here too.

hjh

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-05-21  0:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-17  7:14 Exporting source code blocks as LaTeX figures James Harkins
2013-05-18  7:39 ` Nicolas Goaziou
2013-05-20  4:06   ` James Harkins
2013-05-20  6:30     ` Thomas S. Dye
2013-05-20  7:00       ` James Harkins
2013-05-20  8:54         ` Nicolas Goaziou
2013-05-21  0:13           ` James Harkins

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.