From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Davison Subject: Re: How to get pretty printed source code in PDFLaTeX Date: Mon, 09 Aug 2010 18:29:02 -0400 Message-ID: <87hbj31kup.fsf@stats.ox.ac.uk> References: <308653.38337.qm@web65503.mail.ac4.yahoo.com> <871vacswh4.fsf@stats.ox.ac.uk> <87aap0ol2n.fsf@gmx.de> <877hk4rbco.fsf@stats.ox.ac.uk> <8762zoogf5.fsf@gmx.de> <87k4o4893x.fsf_-_@mundaneum.com> <87vd7nn9lt.fsf@stats.ox.ac.uk> <87aaovcyvc.fsf@mundaneum.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=37280 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OiaqO-0007lG-UR for emacs-orgmode@gnu.org; Mon, 09 Aug 2010 18:29:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OiaqK-0006XU-Cu for emacs-orgmode@gnu.org; Mon, 09 Aug 2010 18:29:20 -0400 Received: from plane.gmane.org ([80.91.229.3]:45378) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OiaqJ-0006XA-Up for emacs-orgmode@gnu.org; Mon, 09 Aug 2010 18:29:16 -0400 Received: from public by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1OiaqF-0008Qv-Mj for emacs-orgmode@gnu.org; Tue, 10 Aug 2010 00:29:11 +0200 In-Reply-To: <87aaovcyvc.fsf@mundaneum.com> (=?utf-8?Q?=22S=C3=A9bastien?= Vauban"'s message of "Mon, 09 Aug 2010 22:30:47 +0200") 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: =?utf-8?Q?S=C3=A9bastien?= Vauban Cc: public-emacs-orgmode-mXXj517/zsQ@plane.gmane.org S=C3=A9bastien Vauban writes: > Hi Dan, > > Dan Davison wrote: >> S=C3=A9bastien Vauban writes: >>> Sebastian Rose wrote: >>>> Dan Davison writes: >>>>> Can you point me to an example that shows how to make source code in >>>>> latex look (almost) as nice as html? >>>> >>>> That is supposed to work with the `listings' package. I havent tried t= hat >>>> yet. >>> >>> If I understand you right, here's such an example you're after: >>> >>> * Much better code [...] >>> I've put the PDF (for easy access) onto my Web site: >>> >>> http://www.mygooglest.com/sva/ECM-Listings.pdf >> >> Wow, that's really nice. Thanks for sharing that. > > I really thought that you used such a thing for a long time, having done = so > much for Org-Babel. Maybe you were more interested by the execution stuff, > rather than its printing? For me, the opposite: I was much interested by = the > printing, now by accessing all the power of Babel. You're probably right that I should have looked into it. But seeing as the HTML export of code is so nice and requred no configuration, I never got round to it. Although I did write my Ph.D. in latex, and I am enjoying using the listings package for formatting pseudocode in a paper which I'm supposed to be writing, I do need to become better friends with latex, it's true. >> I think we should aim to get to a point where org-mode can produce such >> nicely formatted source code out-of-the-box. > > I share your point. I'm willing to participate, or even begin, such a pag= e on > Worg, with the above info. > >> Maybe we could even make latex inherit the colours and fonts that emacs = is >> currently using for source code mark up? > > For sure, that'd be nice. You mean the way htmlize works, and keeps my co= lors, > right? > > Dunno what it implies for Org-LaTeX... Generating your own class customiz= ation, > and having it loaded by default (in the list of LaTeX packages)? Usage of listings is controlled by the variable `org-export-latex-listings', so the simplest start would be: if that is non-nil then code like yours could be inserted into the latex output. > >> I was going to suggest doing this with listings but then came across min= ted, >> and I wonder whether that's even more suitable? (See the other post I ju= st >> made.) > > Never heard about it before, while I'm trying to follow info about TeX as > well. > > I'm very impressed by the quality and reaction time of > french.computers.text.tex. So, I decided to ask them what they thought ab= out > Listings vs Minted. ,---- | "sur un post de Dan Davison parlant d'un nouveau paquet qui=20 | serait mieux que Listings." `---- Hey, I never said that! :)=20 I said it might be better *for export of code from org-mode*. But seriously, no problem, in addition to my character assassination, from what I could make out they made lots of good points. Although I will watch out now if I come across any francophones who look like they might be tex enthusiasts (wouldn't one always...) What I meant is that seeing as org-users who set `org-export-latex-listings' get black and white code with ugly fonts by default, there are two improvement options for us: 1. we work on incorporating nice listings configuration into org mode so that Org users get nice colours and fonts by default 2. we add an option to allow Org users to use the minted package, which gives them nice colours and fonts automatically. (2) was easy and so I did it straight away. And (1) is still something we want to do, not least because listings is in standard latex distributions and doesn't have an extra python requirement. Assuming that minted/pygments are stable software that will be around for a while, I would vote for both options ultimately being available in org-mode. > > See on [[http://groups.google.com/groups/search?as_umsgid%3D87lj8gp4rr.fs= f%40mundaneum.com][Email from S=C3=A9bastien Vauban: Listings vs Minted]] > > What's interesting is that 2 brilliant people of that list responded on t= hat. > I could try to translate the whole, but there already is a lot. Just > highlighting that they don't trust that much all the facts that have been= used > against Listings (and prove what they say): about Utf-8, or the number of > languages, etc. > > They agree with one inconvenient of Listings: the fact that, by default, = it > uses bad settings (like no color, and proportional font). > > On the other hand, they don't like implying the use of an external langua= ge to > LaTeX. Impacts on shell-escape. > > The discussion is going on. I'll keep you posted. > > For sure, the objective of getting better out-of-the-box is a goal we can > reach. Excellent, I think that will be a good addition to org-mode. Dan > > Best regards, > Seb