From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shiyuan Subject: Re: R src block not highlighted in pdf Date: Sat, 28 Jun 2014 22:57:31 -0700 Message-ID: References: <87vbrmou6i.fsf@alphaville.bos.redhat.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0122f0cce7aa4004fcf3378a Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X187K-0003Is-Ma for emacs-orgmode@gnu.org; Sun, 29 Jun 2014 01:57:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X187J-0002mO-Hi for emacs-orgmode@gnu.org; Sun, 29 Jun 2014 01:57:34 -0400 Received: from mail-ve0-x235.google.com ([2607:f8b0:400c:c01::235]:44523) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X187J-0002kn-Ak for emacs-orgmode@gnu.org; Sun, 29 Jun 2014 01:57:33 -0400 Received: by mail-ve0-f181.google.com with SMTP id db11so6982796veb.12 for ; Sat, 28 Jun 2014 22:57:32 -0700 (PDT) In-Reply-To: <87vbrmou6i.fsf@alphaville.bos.redhat.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Cc: "emacs-orgmode@gnu.org" --089e0122f0cce7aa4004fcf3378a Content-Type: text/plain; charset=UTF-8 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 wrote: > Shiyuan 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 > > > --089e0122f0cce7aa4004fcf3378a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thank you for the pointers. I got minted-pygments working = using the following setup:=C2=A0
(setq org-latex-listings 'min= ted)
(add-to-list 'org-latex-packages-alist '(""= ; "minted"))
(setq org-latex-pdf-process
=C2=A0'("pdflatex -shell-escape -interaction n= onstopmode -output-directory %o %f" "pdflatex -shell-escape -inte= raction nonstopmode -output-directory %o %f" =C2=A0"pdflatex -she= ll-escape -interaction nonstopmode -output-directory %o %f"))



On Fri, Jun 27, 2014 at 3:37 PM, Nick Dokos <ndokos@gmail.com= > wrote:
Shiyuan <gshy2014@gmail.com> 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.=C2=A0
>
> (require 'ox-latex)
> =C2=A0 (add-to-list 'org-latex-packages-alist '("" &= quot;listings"))
> =C2=A0 (add-to-list 'org-latex-packages-alist '("" &= quot;color"))
>

Not sure what version of listings I have, but I get the same behaviou= r:
bold face but no color. You have to modify the settings. For example:

\lstset{ %
=C2=A0 ...
=C2=A0 commentstyle=3D\color{green}, =C2=A0 =C2=A0 =C2=A0% comment style =C2=A0 ...}

will colour comments green. See the listings manual for more details:

=C2=A0 =C2=A0http://mirror.hmc.edu/ctan/macros/lat= ex/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 =C2=A0box.

Nick



--089e0122f0cce7aa4004fcf3378a--