[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Problems with source code listings in PDF

From: Rainer M Krug
Subject: Re: [Orgmode] Problems with source code listings in PDF
Date: Tue, 08 Feb 2011 16:25:02 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20110207 Lightning/1.0b2 Shredder/3.1.9pre

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.



#+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

> 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
> 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.
> address@hidden
> 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
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:      address@hidden

Skype:      RMkrug
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/


reply via email to

[Prev in Thread] Current Thread [Next in Thread]