From: "Thomas S. Dye" <tsd@tsdye.com>
To: Andreas Leha <andreas.leha@med.uni-goettingen.de>
Cc: emacs-orgmode@gnu.org
Subject: Re: latex export of source code in lists
Date: Thu, 9 Dec 2010 07:25:19 -1000 [thread overview]
Message-ID: <4666B6D8-8E2C-41F7-B524-B17F2A31B9CF@tsdye.com> (raw)
In-Reply-To: <4D00A395.5050408@med.uni-goettingen.de>
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.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
next prev parent reply other threads:[~2010-12-09 17:27 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-09 9:38 latex export of source code in lists Andreas Leha
2010-12-09 17:25 ` Thomas S. Dye [this message]
2010-12-09 17:47 ` Andreas Leha
2010-12-10 1:29 ` Thomas S. Dye
2010-12-09 20:36 ` Nicolas Goaziou
2010-12-10 17:01 ` Andreas Leha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4666B6D8-8E2C-41F7-B524-B17F2A31B9CF@tsdye.com \
--to=tsd@tsdye.com \
--cc=andreas.leha@med.uni-goettingen.de \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).