From mboxrd@z Thu Jan 1 00:00:00 1970 From: James Harkins Subject: Re: Exporting source code blocks as LaTeX figures Date: Mon, 20 May 2013 15:00:53 +0800 Message-ID: References: <87r4h4ohx6.fsf@gmail.com> 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]:58186) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UeK5X-0005ZJ-TB for Emacs-orgmode@gnu.org; Mon, 20 May 2013 03:01:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UeK5W-0002cu-C8 for Emacs-orgmode@gnu.org; Mon, 20 May 2013 03:00:55 -0400 Received: from mail-oa0-f51.google.com ([209.85.219.51]:57231) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UeK5W-0002cn-5s for Emacs-orgmode@gnu.org; Mon, 20 May 2013 03:00:54 -0400 Received: by mail-oa0-f51.google.com with SMTP id f4so7206062oah.24 for ; Mon, 20 May 2013 00:00:53 -0700 (PDT) In-Reply-To: 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: "Thomas S. Dye" Cc: "Emacs-orgmode@gnu.org" On Mon, May 20, 2013 at 2:30 PM, Thomas S. Dye wrote: >> Then the next problem... I'm going to have some figures that need to >> span two columns. According to [1], I should use \begin{figure*} ... >> \end{figure*}. Is there a way to do that using a special block? (First >> guess, "#+BEGIN_figure*" causes the special block not to be >> recognized.) Or do I need to write the literal LaTeX code for that? > > No, you don't need to write literal LaTeX code. See Section 12.7.4 of > the manual, which describes setting the :float attribute to > 'multicolumn'. That section of the manual seems to describe the behavior for images. I did try: #+ATTR_LaTeX: :multicolumn :options [htb] #+BEGIN_figure ... #+END_figure ... and :multicolumn had no effect on the output LaTeX code (either with or without the preceding ":" -- I tried both): \begin{figure}[htb] \lstset{language={},label=code1,caption={Some code},numbers=none} \begin{lstlisting} // SuperCollider code here ..... \end{lstlisting} \end{figure} Nor does this make a difference: #+ATTR_LaTeX: :float multicolumn :options [htb] #+BEGIN_figure And if I omit BEGIN_figure altogether, and try to apply :float directly to the source code block, then the floating environment doesn't appear in the LaTeX code at all. The other reference to multicolumn is for table export, and this isn't a table either. So I think, as currently designed, :multicolumn simply doesn't apply. I'm aware that BEGIN_figure delimits a "special block" which translates into LaTeX as an arbitrary environment, and not all environments can be floated safely... but perhaps one approach for the future would be to consider BEGIN_figure to be an extra-special "special block" where we know that the properties of LaTeX floating bodies are valid. Or relax the restriction so that BEGIN_figure* no longer tries to treat _ as a subscript marker. hjh