From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Baier Subject: Re: [Latex] Don't push code blocks to end of document Date: Wed, 25 Jun 2014 14:22:42 +0200 Message-ID: <87ionpkwkt.fsf@mailbox.org> References: <8738evodqe.fsf@student.kit.edu> <87oaxj8wda.fsf@gmail.com> <87y4wnmpio.fsf@mailbox.org> <87pphymqts.fsf@mailbox.org> <87tx79kzfw.fsf_-_@mailbox.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47404) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzmEC-0002qU-11 for emacs-orgmode@gnu.org; Wed, 25 Jun 2014 08:23:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WzmE4-0008V2-5V for emacs-orgmode@gnu.org; Wed, 25 Jun 2014 08:23:03 -0400 Received: from mx2.mailbox.org ([80.241.60.215]:49045) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzmE3-0008Un-SU for emacs-orgmode@gnu.org; Wed, 25 Jun 2014 08:22:56 -0400 In-Reply-To: <87tx79kzfw.fsf_-_@mailbox.org> (Alexander Baier's message of "Wed, 25 Jun 2014 13:20:51 +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 Hello again, this is another follow up, I am sorry for so much noise. On 2014-06-25 13:20 Alexander Baier wrote: > 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. I fixed this by using the listings package. I set "org-latex-listings" to true and followed the instructions in the doc string of said variable. Now, my code blocks are placed where I want them and are even syntax highlighted! [...] Regards, -- Alexander Baier