From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thomas S. Dye" Subject: Re: latex export of source code in lists Date: Thu, 9 Dec 2010 07:25:19 -1000 Message-ID: <4666B6D8-8E2C-41F7-B524-B17F2A31B9CF@tsdye.com> References: <4D00A395.5050408@med.uni-goettingen.de> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=52407 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQkHe-0001yk-0b for emacs-orgmode@gnu.org; Thu, 09 Dec 2010 12:27:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQkHc-00010P-Ii for emacs-orgmode@gnu.org; Thu, 09 Dec 2010 12:27:57 -0500 Received: from oproxy3-pub.bluehost.com ([69.89.21.8]:37186) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PQkHc-000109-8u for emacs-orgmode@gnu.org; Thu, 09 Dec 2010 12:27:56 -0500 In-Reply-To: <4D00A395.5050408@med.uni-goettingen.de> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Andreas Leha Cc: emacs-orgmode@gnu.org 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