From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shiyuan Subject: R src block not highlighted in pdf Date: Fri, 27 Jun 2014 10:23:33 -0700 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b342d30a2303e04fcd491f8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0Zs7-0001aB-ND for emacs-orgmode@gnu.org; Fri, 27 Jun 2014 13:23:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X0Zs6-0005rd-SP for emacs-orgmode@gnu.org; Fri, 27 Jun 2014 13:23:35 -0400 Received: from mail-vc0-x22e.google.com ([2607:f8b0:400c:c03::22e]:46864) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0Zs6-0005rT-Dp for emacs-orgmode@gnu.org; Fri, 27 Jun 2014 13:23:34 -0400 Received: by mail-vc0-f174.google.com with SMTP id hy4so5433145vcb.33 for ; Fri, 27 Jun 2014 10:23:33 -0700 (PDT) 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 To: emacs-orgmode@gnu.org --047d7b342d30a2303e04fcd491f8 Content-Type: text/plain; charset=UTF-8 Hi, I have a R code src block in a org file. When exported to html, the R code is correctly syntax highlighted. But when exported to pdf(latex), the R code is not highlighted. I found this thread https://lists.gnu.org/archive/html/emacs-orgmode/2010-07/msg00379.html which suggests setting the variable org-export-latex-listings. This variable seems no longer exist in Org 8.2.6. What variables shall I set so that the R code is syntax highlighted when exported to pdf in Org mode 8.2.6? Thanks. Shiyuan --047d7b342d30a2303e04fcd491f8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,=C2=A0
=C2=A0 =C2=A0 I have a R code src block= in a org file. When exported to html, the R code is correctly syntax highl= ighted. But when exported to pdf(latex), the R code is not highlighted. I f= ound this thread https://lists.gnu.org/archive/html/emacs-orgmode/2= 010-07/msg00379.html=C2=A0=C2=A0=C2=A0which suggests setting the variab= le org-export-latex-listings. This variabl= e seems no longer exist in Org 8.2.6. =C2=A0What variables shall I set so t= hat the R code is syntax highlighted when exported to pdf in Org mode 8.2.6= ? Thanks.=C2=A0

Shiyuan=C2=A0
--047d7b342d30a2303e04fcd491f8-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Rettke Subject: Re: R src block not highlighted in pdf Date: Fri, 27 Jun 2014 13:38:52 -0500 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0b30-0003DD-Fc for emacs-orgmode@gnu.org; Fri, 27 Jun 2014 14:38:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X0b2z-0004ZR-DG for emacs-orgmode@gnu.org; Fri, 27 Jun 2014 14:38:54 -0400 Received: from mail-ob0-x231.google.com ([2607:f8b0:4003:c01::231]:42888) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0b2z-0004ZL-3O for emacs-orgmode@gnu.org; Fri, 27 Jun 2014 14:38:53 -0400 Received: by mail-ob0-f177.google.com with SMTP id uy5so5856798obc.22 for ; Fri, 27 Jun 2014 11:38:52 -0700 (PDT) In-Reply-To: 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 To: Shiyuan Cc: "emacs-orgmode@gnu.org" Just ran apropos and it looks like org-latex-listings might be the one. Grant Rettke | ACM, ASA, FSF, IEEE, SIAM gcr@wisdomandwonder.com | http://www.wisdomandwonder.com/ =E2=80=9CWisdom begins in wonder.=E2=80=9D --Socrates ((=CE=BB (x) (x x)) (=CE=BB (x) (x x))) =E2=80=9CLife has become immeasurably better since I have been forced to st= op taking it seriously.=E2=80=9D --Thompson On Fri, Jun 27, 2014 at 12:23 PM, Shiyuan wrote: > Hi, > I have a R code src block in a org file. When exported to html, the R > code is correctly syntax highlighted. But when exported to pdf(latex), th= e R > code is not highlighted. I found this thread > https://lists.gnu.org/archive/html/emacs-orgmode/2010-07/msg00379.html > which suggests setting the variable org-export-latex-listings. This varia= ble > seems no longer exist in Org 8.2.6. What variables shall I set so that t= he > R code is syntax highlighted when exported to pdf in Org mode 8.2.6? Than= ks. > > Shiyuan From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: R src block not highlighted in pdf Date: Fri, 27 Jun 2014 08:39:29 -1000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56216) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0b3s-0004IX-UA for emacs-orgmode@gnu.org; Fri, 27 Jun 2014 14:39:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X0b3m-0004if-At for emacs-orgmode@gnu.org; Fri, 27 Jun 2014 14:39:48 -0400 Received: from gproxy2-pub.mail.unifiedlayer.com ([69.89.18.3]:60520) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1X0b3m-0004hh-2Q for emacs-orgmode@gnu.org; Fri, 27 Jun 2014 14:39:42 -0400 In-Reply-To: (Shiyuan's message of "Fri, 27 Jun 2014 10:23:33 -0700") 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 To: Shiyuan Cc: emacs-orgmode@gnu.org Aloha Shiyuan, Shiyuan writes: > Hi, > I have a R code src block in a org file. When exported to html, the R > code is correctly syntax highlighted. But when exported to pdf(latex), the > R code is not highlighted. I found this thread > https://lists.gnu.org/archive/html/emacs-orgmode/2010-07/msg00379.html > which > suggests setting the variable org-export-latex-listings. This variable > seems no longer exist in Org 8.2.6. What variables shall I set so that the > R code is syntax highlighted when exported to pdf in Org mode 8.2.6? > Thanks. > > Shiyuan > Hi, > I have a R code src block in a org file. When exported to html, the R > code is correctly syntax highlighted. But when exported to pdf(latex), > the R code is not highlighted. I found this thread > https://lists.gnu.org/archive/html/emacs-orgmode/2010-07/msg00379.html > which suggests setting the variable org-export-latex-listings. This > variable seems no longer exist in Org 8.2.6. What variables shall I > set so that the R code is syntax highlighted when exported to pdf in > Org mode 8.2.6? Thanks. That variable was renamed org-latex-listings in v. 8. hth, Tom -- Thomas S. Dye http://www.tsdye.com From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shiyuan Subject: Re: R src block not highlighted in pdf Date: Fri, 27 Jun 2014 14:46:46 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=20cf302efbb2f9cea904fcd83e87 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40818) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0dyq-0007E5-Qn for emacs-orgmode@gnu.org; Fri, 27 Jun 2014 17:46:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X0dyp-0002Pa-AY for emacs-orgmode@gnu.org; Fri, 27 Jun 2014 17:46:48 -0400 Received: from mail-ve0-x229.google.com ([2607:f8b0:400c:c01::229]:40352) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0dyp-0002P8-47 for emacs-orgmode@gnu.org; Fri, 27 Jun 2014 17:46:47 -0400 Received: by mail-ve0-f169.google.com with SMTP id pa12so5957419veb.28 for ; Fri, 27 Jun 2014 14:46:46 -0700 (PDT) In-Reply-To: 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 To: Grant Rettke , tsd@tsdye.com Cc: "emacs-orgmode@gnu.org" --20cf302efbb2f9cea904fcd83e87 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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")) Also, thank you for reminding me of the `apropos`. On Fri, Jun 27, 2014 at 11:38 AM, Grant Rettke wrote: > Just ran apropos and it looks like org-latex-listings might be the one. > Grant Rettke | ACM, ASA, FSF, IEEE, SIAM > gcr@wisdomandwonder.com | http://www.wisdomandwonder.com/ > =E2=80=9CWisdom begins in wonder.=E2=80=9D --Socrates > ((=CE=BB (x) (x x)) (=CE=BB (x) (x x))) > =E2=80=9CLife has become immeasurably better since I have been forced to = stop > taking it seriously.=E2=80=9D --Thompson > > > On Fri, Jun 27, 2014 at 12:23 PM, Shiyuan wrote: > > Hi, > > I have a R code src block in a org file. When exported to html, the= R > > code is correctly syntax highlighted. But when exported to pdf(latex), > the R > > code is not highlighted. I found this thread > > https://lists.gnu.org/archive/html/emacs-orgmode/2010-07/msg00379.html > > which suggests setting the variable org-export-latex-listings. This > variable > > seems no longer exist in Org 8.2.6. What variables shall I set so that > the > > R code is syntax highlighted when exported to pdf in Org mode 8.2.6? > Thanks. > > > > Shiyuan > --20cf302efbb2f9cea904fcd83e87 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I use the following setting. The keywords are co= rrectly recognized and are in bold face, but not in color. Are there any ot= her 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 '("" "color"))

Als= o, thank you for reminding me of the `apropos`.=C2=A0


On Fri, Jun 2= 7, 2014 at 11:38 AM, Grant Rettke <gcr@wisdomandwonder.com> wrote:
Just ran apropos and it looks like org-latex= -listings might be the one.
Grant Rettke | ACM, ASA, FSF= , IEEE, SIAM
gcr@wisdomandwonder.com | http://www.wisd= omandwonder.com/
=E2=80=9CWisdom begins in wonder.=E2=80=9D --Socrates
((=CE=BB (x) (x x)) (=CE=BB (x) (x x)))
=E2=80=9CLife has become immeasurably better since I have been forced to st= op
taking it seriously.=E2=80=9D --Thompson


On Fri, Jun 27, 2014 at 12:23 PM, Shiyuan <gshy2014@gmail.com> wrote:
> Hi,
> =C2=A0 =C2=A0 I have a R code src block in a org file. When exported t= o html, the R
> code is correctly syntax highlighted. But when exported to pdf(latex),= the R
> code is not highlighted. I found this thread
> https://lists.gnu.org/archive/html/emacs-org= mode/2010-07/msg00379.html
> which suggests setting the variable org-export-latex-listings. This va= riable
> seems no longer exist in Org 8.2.6. =C2=A0What variables shall I set s= o that the
> R code is syntax highlighted when exported to pdf in Org mode 8.2.6? T= hanks.
>
> Shiyuan

--20cf302efbb2f9cea904fcd83e87-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: R src block not highlighted in pdf Date: Fri, 27 Jun 2014 18:37:41 -0400 Message-ID: <87vbrmou6i.fsf@alphaville.bos.redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49566) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0emR-0000Xe-4K for emacs-orgmode@gnu.org; Fri, 27 Jun 2014 18:38:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X0emJ-0002NF-6y for emacs-orgmode@gnu.org; Fri, 27 Jun 2014 18:38:03 -0400 Received: from plane.gmane.org ([80.91.229.3]:58462) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0emJ-0002N2-0i for emacs-orgmode@gnu.org; Fri, 27 Jun 2014 18:37:55 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1X0emI-0001BL-1G for emacs-orgmode@gnu.org; Sat, 28 Jun 2014 00:37:54 +0200 Received: from nat-pool-bos-t.redhat.com ([66.187.233.206]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 28 Jun 2014 00:37:54 +0200 Received: from ndokos by nat-pool-bos-t.redhat.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 28 Jun 2014 00:37:54 +0200 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 To: emacs-orgmode@gnu.org 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 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--