[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] R src block not highlighted in pdf
From: |
Nick Dokos |
Subject: |
Re: [O] R src block not highlighted in pdf |
Date: |
Fri, 27 Jun 2014 18:37:41 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) |
Shiyuan <address@hidden> writes:
> I use the following setting. The keywords are correctly recognized and are in
> bold face, but not in color. Are there any other
> steps for colors.
>
> (require 'ox-latex)
> (add-to-list 'org-latex-packages-alist '("" "listings"))
> (add-to-list 'org-latex-packages-alist '("" "color"))
>
Not sure what version of listings I have, but I get the same behaviour:
bold face but no color. You have to modify the settings. For example:
\lstset{ %
...
commentstyle=\color{green}, % comment style
...}
will colour comments green. See the listings manual for more details:
http://mirror.hmc.edu/ctan/macros/latex/contrib/listings/listings.pdf
You might want to try pygments and minted instead. It's a bit fiddly
to set up but does give you colour out of the box.
Nick