emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric S Fraga <e.fraga@ucl.ac.uk>
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 15:17:00 +0000	[thread overview]
Message-ID: <87k4haeetv.fsf@ucl.ac.uk> (raw)
In-Reply-To: <AANLkTi=Krj2p4__CZD919V4voZn5Q=2CvvqNZGHL-BpQ@mail.gmail.com> (Avdi Grimm's message of "Tue, 8 Feb 2011 09:59:55 -0500")

Avdi Grimm <groups@inbox.avdi.org> writes:

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

I must admit that colour has never been something I've considered...
it is, however, an option for the listings package.

> 2. Listings are formatted in a not-very-well-rendered font with serifs
> that just doesn't look good at all.

I've had no problems with typeface etc for listings in the past.

> 3. In begin_example sections, spaces are replaced with odd little
> curved underscores.

The use of curved underscores for spaces is deliberate and whether this
is done will depend on your source language.  You can customise this in
any case (see below).

In summary, you may need to add a line customising the listings
package.  Check out the user manual at

: ftp://ftp.tex.ac.uk/tex-archive/macros/latex/contrib/listings/listings.pdf

and then have something like this in your org file near the top:

#+latex_header: \lstset{showspaces=false, ...}

(replacing ... with the other options you may wish).

HTH.

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.4 (release_7.4.319.g88b7.dirty)

  reply	other threads:[~2011-02-08 15:18 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 [this message]
2011-02-08 15:25 ` Rainer M Krug
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=87k4haeetv.fsf@ucl.ac.uk \
    --to=e.fraga@ucl.ac.uk \
    --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).