emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] [Latex] Don't push code blocks to end of document


From: Alexander Baier
Subject: Re: [O] [Latex] Don't push code blocks to end of document
Date: Wed, 25 Jun 2014 14:22:42 +0200
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (gnu/linux)

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



reply via email to

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