From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Harkins Subject: Exporting source code blocks as LaTeX figures Date: Fri, 17 May 2013 15:14:21 +0800 Message-ID: Reply-To: jamshark70@dewdrop-world.net Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:36062) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UdFU8-000170-4w for Emacs-orgmode@gnu.org; Fri, 17 May 2013 03:53:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UdFU3-0007nq-EQ for Emacs-orgmode@gnu.org; Fri, 17 May 2013 03:53:52 -0400 Received: from mail-ob0-x22b.google.com ([2607:f8b0:4003:c01::22b]:40749) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UdEru-0006Zd-Kd for Emacs-orgmode@gnu.org; Fri, 17 May 2013 03:14:22 -0400 Received: by mail-ob0-f171.google.com with SMTP id ef5so4360167obb.2 for ; Fri, 17 May 2013 00:14:21 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org 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