* Re: Problems with source code listings in PDF
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
2011-02-08 15:47 ` Thomas S. Dye
2 siblings, 0 replies; 5+ messages in thread
From: Rainer M Krug @ 2011-02-08 15:25 UTC (permalink / raw)
To: Avdi Grimm; +Cc: emacs-orgmode
-----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-----
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Problems with source code listings in PDF
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
@ 2011-02-08 15:47 ` Thomas S. Dye
2011-02-09 13:25 ` Robert Klein
2 siblings, 1 reply; 5+ messages in thread
From: Thomas S. Dye @ 2011-02-08 15:47 UTC (permalink / raw)
To: Avdi Grimm; +Cc: emacs-orgmode
[-- Attachment #1.1: Type: text/plain, Size: 1684 bytes --]
On Feb 8, 2011, at 4:59 AM, 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
> 2. Listings are formatted in a not-very-well-rendered font with serifs
> that just doesn't look good at all.
Instructions for setting up different fonts can be found here:
http://orgmode.org/worg/org-tutorials/org-latex-export.html#sec-14
Note that some of the fonts clash with the amssymb LaTeX package,
which Org-mode loads by default. You'll want to choose a font that
doesn't clash, or configure Org-mode so the amssymb package isn't
loaded.
All the best,
Tom
> 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
> <
> example
> .png><listing.png>_______________________________________________
> 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
[-- Attachment #1.2: Type: text/html, Size: 2329 bytes --]
[-- Attachment #2: Type: text/plain, Size: 201 bytes --]
_______________________________________________
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
^ permalink raw reply [flat|nested] 5+ messages in thread