emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [Latex] Don't push code blocks to end of document (was: Source block


From: Alexander Baier
Subject: [O] [Latex] Don't push code blocks to end of document (was: Source blocks with captions)
Date: Wed, 25 Jun 2014 13:20:51 +0200
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (gnu/linux)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]