From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: Problems with source code listings in PDF Date: Tue, 08 Feb 2011 16:25:02 +0100 Message-ID: <4D51604E.3090106@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=45873 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PmpRE-0007OX-BQ for emacs-orgmode@gnu.org; Tue, 08 Feb 2011 10:25:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PmpRC-0002XB-7c for emacs-orgmode@gnu.org; Tue, 08 Feb 2011 10:25:08 -0500 Received: from mail-wy0-f169.google.com ([74.125.82.169]:60342) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PmpRC-0002Wm-0i for emacs-orgmode@gnu.org; Tue, 08 Feb 2011 10:25:06 -0500 Received: by wyj26 with SMTP id 26so6178926wyj.0 for ; Tue, 08 Feb 2011 07:25:05 -0800 (PST) In-Reply-To: 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: Avdi Grimm Cc: emacs-orgmode@gnu.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 02/08/2011 03:59 PM, Avdi Grimm wrote: > I'm working on creating a PDF eBook with Org-Mode, and I'm running > into some difficulty getting them to come out looking decent. > > I've followed the directions I found in the list archives for > outputting colorized source code listings. I set > org-export-latex-listings to t, and customized > org-export-latex-packages-alist according to the directions in the > org-export-latex-listings docs. > > I'm seeing a few problems with the output: > > 1. There is no color; only bolded keywords. add these definitions to the headers of the org file - they should provide colour and a list of other things you can customize - these are not from me, I think they are from this list or from worg. Cheers, Rainer #+LATEX_HEADER: \definecolor{light-gray}{gray}{0.9} #+LATEX_HEADER: \lstset{% #+LATEX_HEADER: basicstyle=\ttfamily\tiny, % the font that is used for the code #+LATEX_HEADER: tabsize=4, % sets default tabsize to 4 spaces #+LATEX_HEADER: numbers=left, % where to put the line numbers #+LATEX_HEADER: numberstyle=\tiny, % line number font size #+LATEX_HEADER: stepnumber=0, % step between two line numbers #+LATEX_HEADER: breaklines=true, %!! don't break long lines of code #+LATEX_HEADER: showtabs=false, % show tabs within strings adding particular underscores #+LATEX_HEADER: showspaces=false, % show spaces adding particular underscores #+LATEX_HEADER: showstringspaces=false, % underline spaces within strings #+LATEX_HEADER: keywordstyle=\color{blue}, #+LATEX_HEADER: identifierstyle=\color{black}, #+LATEX_HEADER: stringstyle=\color{green}, #+LATEX_HEADER: commentstyle=\color{red}, #+LATEX_HEADER: backgroundcolor=\color{light-gray}, % sets the background color #+LATEX_HEADER: columns=fullflexible, #+LATEX_HEADER: basewidth={0.5em,0.4em}, #+LATEX_HEADER: captionpos=b, % sets the caption position to `bottom' #+LATEX_HEADER: extendedchars=false %!?? workaround for when the listed file is in UTF-8 #+LATEX_HEADER: } > 2. Listings are formatted in a not-very-well-rendered font with serifs > that just doesn't look good at all. > 3. In begin_example sections, spaces are replaced with odd little > curved underscores. > > I've attached some examples to show what I mean. > > I'm running Org-Mode 7.4 on Ubuntu 10.10 with Emacs 23.1.50.1. > > Has anyone had any luck formatting source code and example listings in > PDF output? What I'd really like to get is output identical to the > listings exported to HTML. > > Thanks! > > -- > Avdi Grimm > > > > _______________________________________________ > 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 - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Natural Sciences Building Office Suite 2039 Stellenbosch University Main Campus, Merriman Avenue Stellenbosch South Africa Tel: +33 - (0)9 53 10 27 44 Cell: +27 - (0)8 39 47 90 42 Fax (SA): +27 - (0)8 65 16 27 82 Fax (D) : +49 - (0)3 21 21 25 22 44 Fax (FR): +33 - (0)9 58 10 27 44 email: Rainer@krugs.de Skype: RMkrug -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk1RYE4ACgkQoYgNqgF2egqzHQCfVFZ9nQP5l1cEsCaFpzRyR2vv o9MAnArHaXN8pPEDoZE4ATdt/6OgN2Wq =xwFH -----END PGP SIGNATURE-----