From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Baier Subject: [Latex] Don't push code blocks to end of document (was: Source blocks with captions) Date: Wed, 25 Jun 2014 13:20:51 +0200 Message-ID: <87tx79kzfw.fsf_-_@mailbox.org> References: <8738evodqe.fsf@student.kit.edu> <87oaxj8wda.fsf@gmail.com> <87y4wnmpio.fsf@mailbox.org> <87pphymqts.fsf@mailbox.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33426) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzlGJ-000598-Hh for emacs-orgmode@gnu.org; Wed, 25 Jun 2014 07:21:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WzlGC-0001WS-HW for emacs-orgmode@gnu.org; Wed, 25 Jun 2014 07:21:11 -0400 Received: from mx1.mailbox.org ([80.241.60.212]:35024) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzlGC-0001W9-7Z for emacs-orgmode@gnu.org; Wed, 25 Jun 2014 07:21:04 -0400 In-Reply-To: <87pphymqts.fsf@mailbox.org> (Alexander Baier's message of "Tue, 24 Jun 2014 14:31:43 +0200") 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, Thorsten Jolitz On 2014-06-24 14:31 Alexander Baier wrote: [...] >> With this code: >> >> * Test >> >> #+CAPTION: Test >> #+BEGIN_SRC java >> // some code >> #+END_SRC >> >> I get a figure with a caption when exporting to LaTeX: >> >> \section{Test} >> \label{sec-1} >> >> \begin{figure}[H] >> \begin{verbatim} >> // some code >> \end{verbatim}\caption{Test} >> >> \end{figure} >> >> You don't need to name the source code block, although it is typically a >> good idea to do so. > > I always only looked at the generated PDF to see if there was a caption > added. When opening the generated .tex file I found the same code you > are seeing. It seems the document class I am using just drops the > caption. > > The class in question is LLNCS, does anyone know why this could happen? In fact, the document class does not drop those captions, it just moves the listings to the end of the document, where I did not see them. How do I prevent this from happening? It is not much use to me if _all_ my listings are pushed to the very end of my document. I would like latex to place them in the vicinity of where I defined my code block in org. This is the test file showing the behaviour described above: ---------------------------------------------------------------- #+LANGUAGE: de #+OPTIONS: tasks:nil num:3 toc:nil ':t ":t #+LATEX_CLASS: llncs #+TITLE: Test * A headline Some words before the source code block. For good measure, here is a link to listing [[src:foo]]. #+NAME: src:foo #+CAPTION: test caption. #+BEGIN_SRC java interface Foo { void bar(); } #+END_SRC And some words after the block. ---------------------------------------------------------------- Thanks, -- Alexander Baier