emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] R src block not highlighted in pdf


From: Shiyuan
Subject: Re: [O] R src block not highlighted in pdf
Date: Sat, 28 Jun 2014 22:57:31 -0700

Thank you for the pointers. I got minted-pygments working using the following setup: 
(setq org-latex-listings 'minted)
(add-to-list 'org-latex-packages-alist '("" "minted"))
(setq org-latex-pdf-process
 '("pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f" "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"  "pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"))



On Fri, Jun 27, 2014 at 3:37 PM, Nick Dokos <address@hidden> wrote:
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




reply via email to

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