emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rainer M Krug <r.m.krug@gmail.com>
To: Avdi Grimm <groups@inbox.avdi.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: Problems with source code listings in PDF
Date: Tue, 08 Feb 2011 16:25:02 +0100	[thread overview]
Message-ID: <4D51604E.3090106@gmail.com> (raw)
In-Reply-To: <AANLkTi=Krj2p4__CZD919V4voZn5Q=2CvvqNZGHL-BpQ@mail.gmail.com>

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

  parent reply	other threads:[~2011-02-08 15:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-08 14:59 Problems with source code listings in PDF Avdi Grimm
2011-02-08 15:17 ` Eric S Fraga
2011-02-08 15:25 ` Rainer M Krug [this message]
2011-02-08 15:47 ` Thomas S. Dye
2011-02-09 13:25   ` Robert Klein

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D51604E.3090106@gmail.com \
    --to=r.m.krug@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=groups@inbox.avdi.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).