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 15:29:01 -1000 Message-ID: References: <4D00A395.5050408@med.uni-goettingen.de> <4666B6D8-8E2C-41F7-B524-B17F2A31B9CF@tsdye.com> <4D01162B.4060207@med.uni-goettingen.de> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=ISO-8859-1; format=flowed; delsp=yes Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=44512 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQrna-0007VG-RK for emacs-orgmode@gnu.org; Thu, 09 Dec 2010 20:29:38 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PQrnO-00067c-Rt for emacs-orgmode@gnu.org; Thu, 09 Dec 2010 20:29:26 -0500 Received: from cpoproxy3-pub.bluehost.com ([67.222.54.6]:55195) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PQrnO-00067E-Lv for emacs-orgmode@gnu.org; Thu, 09 Dec 2010 20:29:14 -0500 In-Reply-To: <4D01162B.4060207@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 Aloha Andreas, I gather Nicolas Goaziou has worked some magic so that your example =20 works with lists now. I had problems using the listings package in situations where LaTeX =20 changes \linewidth, as it can do inside lists. I got bad line breaks =20= and wasn't able to make them good. If listings works for you in this =20= kind of environment, please let me know how you got it to work. All the best, Tom On Dec 9, 2010, at 7:47 AM, Andreas Leha wrote: > 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, =20 > 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=3DR} >>> \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=3DR} >>> \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 >> > > --=20 > Andreas Leha > > Universit=E4tsmedizin G=F6ttingen > Abteilung Medizinische Statistik > Humboldtallee 32 > 37073 G=F6ttingen > > 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=F6ttingen > Department for Medical Statistics > Humboldtallee 32 > 37073 G=F6ttingen > Germany > > Phone: +49 (0) 551 39-10710 > Fax: +49 (0) 551 39-4995 > > http://www.ams.med.uni-goettingen.de/amsneu/leha-en.html > > > _______________________________________________ > 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