emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] latex export of source code in lists


From: Andreas Leha
Subject: Re: [Orgmode] latex export of source code in lists
Date: Thu, 09 Dec 2010 18:47:23 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.15) Gecko/20101030 Iceowl/1.0b1 Icedove/3.0.10

Hi Tom,

thanks for all your input!  This is great.

Using a float environment around my listings is an option I have not
considered yet, as I have a lot of code snippets in the one file, which
would result in several pages of floating listings.  But I'll use that
option anyway or do completely without lists then.

Thanks again,
Andreas



Am 09.12.2010 18:25, schrieb Thomas S. Dye:
> Hi Andreas,
>
> In my experience, lists are a bit fragile this way (probably
> necessarily).  One workaround might be to float the source code block
> (in the way I mentioned in a previous message) and then cross
> reference it from the list.
>
> * Test
>   1) this is the first item (Listing \ref{fig:first-code})
>   2) this is the second item (Listing \ref{fig:second-code})
>
> But this might not be what you're after.
>
> All the best,
> Tom
>
> On Dec 8, 2010, at 11:38 PM, Andreas Leha wrote:
>
>> Hi all,
>>
>> (how) can I have source code block in lists not breaking the latex
>> exported list?
>>
>> Example:
>> * Test
>>  1) this is the first item
>>     #+srcname: code
>>     #+begin_src R :tangle no :export code
>>       print("some code")
>>     #+end_src
>>     which has some code
>>
>>  2) this is the second item
>>
>> This results in
>>  \section{Test}
>>  \label{sec-1}
>>
>>  \begin{enumerate}
>>  \item this is the first item
>>  \end{enumerate}
>>
>>  \lstset{language=R}
>>  \begin{lstlisting}
>>  print("some code")
>>  \end{lstlisting}
>>       which has some code
>>
>>  \begin{enumerate}
>>  \item this is the second item
>>  \end{enumerate}
>>
>> While I expect this:
>>  \section{Test}
>>  \label{sec-1}
>>
>>  \begin{enumerate}
>>  \item this is the first item
>>    \lstset{language=R}
>>    \begin{lstlisting}
>>    print("some code")
>>    \end{lstlisting}
>>     which has some code
>>
>>  \item this is the second item
>>  \end{enumerate}
>>
>> Thanks,
>> Andreas
>>
>>
>>
>> _______________________________________________
>> Emacs-orgmode mailing list
>> Please use `Reply All' to send replies to the list.
>> address@hidden
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>

-- 
Andreas Leha

Universitätsmedizin Göttingen
Abteilung Medizinische Statistik
Humboldtallee 32
37073 Göttingen

Tel: +49 (0)551 39-10710
Fax: +49 (0)551 39-4995

http://www.ams.med.uni-goettingen.de/amsneu/leha.html



University Medical Center Göttingen
Department for Medical Statistics
Humboldtallee 32
37073 Göttingen
Germany

Phone: +49 (0) 551 39-10710
Fax: +49 (0) 551 39-4995

http://www.ams.med.uni-goettingen.de/amsneu/leha-en.html


Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


reply via email to

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