emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: James Harkins <jamshark70@gmail.com>
To: "Emacs-orgmode@gnu.org" <Emacs-orgmode@gnu.org>
Subject: Exporting source code blocks as LaTeX figures
Date: Fri, 17 May 2013 15:14:21 +0800	[thread overview]
Message-ID: <CAFniQ7XoK+kBn66KGh-gRU41oCuchKgJQoJAO+QhMVbHTHn3Hw@mail.gmail.com> (raw)

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

             reply	other threads:[~2013-05-17  7:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-17  7:14 James Harkins [this message]
2013-05-18  7:39 ` Exporting source code blocks as LaTeX figures 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

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=CAFniQ7XoK+kBn66KGh-gRU41oCuchKgJQoJAO+QhMVbHTHn3Hw@mail.gmail.com \
    --to=jamshark70@gmail.com \
    --cc=Emacs-orgmode@gnu.org \
    --cc=jamshark70@dewdrop-world.net \
    /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).