From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rainer M Krug Subject: Re: Color of exported R code results using LaTeX listings Date: Fri, 17 Sep 2010 11:05:22 +0200 Message-ID: <4C932F52.7090601@gmail.com> References: <1284708719.2732.28.camel@sduofa-desktop> <4C932002.6070105@gmail.com> <1284712131.2732.35.camel@sduofa-desktop> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=48116 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OwWsp-0001Ax-CU for emacs-orgmode@gnu.org; Fri, 17 Sep 2010 05:05:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OwWsn-0004d1-OD for emacs-orgmode@gnu.org; Fri, 17 Sep 2010 05:05:27 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:37022) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OwWsn-0004cm-Et for emacs-orgmode@gnu.org; Fri, 17 Sep 2010 05:05:25 -0400 Received: by wyb36 with SMTP id 36so2740158wyb.0 for ; Fri, 17 Sep 2010 02:05:24 -0700 (PDT) In-Reply-To: <1284712131.2732.35.camel@sduofa-desktop> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Steven Delean Cc: emacs-orgmode@gnu.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 17/09/10 10:28, Steven Delean wrote: > Hi Rainer, > > Yes, you will need to provide arguments to the \lstset listings variable > (i.e. add these arguments to a #+BEAMER_HEADER_EXTRA: line). Below are > the subset of arguments that I am using so far, though greater > customisation is available (see listings.pdf > www.ctan.org/tex-archive/macros/latex/contrib/listings/listings.pdf). > > \lstset{ > keywordstyle=\color{blue}, > commentstyle=\color{red}, > stringstyle=\color{green}, > basicstyle=\ttfamily\small, > columns=fullflexible, > basewidth={0.5em,0.4em} > } Now this explains it - thanks a million - works absolutely perfectly. Could that info be added to worg or even the org manual? It mentions the listings and color package are mentioned, but not that colors need to be specified to have colors in the resulting latex / pdf file. Thanks a lot, Rainer > > Cheers, > Steve > > > On Fri, 2010-09-17 at 10:00 +0200, Rainer M Krug wrote: > On 17/09/10 09:31, Steven Delean wrote: >>>> Hi everyone, >>>> >>>> I am using org-mode to make a beamer presentation that includes >>>> blocks of R code and wish to export the source code and results to >>>> pdf in color (using the listings package). >>>> >>>> The source code block syntax is highlighted successfully, but the >>>> output results of the executed R code are not colored at all. > > Hi > > This is not an answer to your question, but rather a question to you: > I added your settings to my .emacs file, and I get fontification in the > pdf output, but no color. Do I need any additional settings to get > coloring of the source code? > > Cheers, > > Rainer > >>>> >>>> The results are presented in \begin{verbatim}...\end{verbatim}, >>>> whereas the source code is presented within >>>> \begin{lstlisting}...\end{lstlisting}. I can affect changes to the >>>> fontsize and color of the source code using \lstset in the .org >>>> document header, but not the results output from evaluating the >>>> code. >>>> >>>> Is there some way I can export these results in color? >>>> >>>> Thanks for any suggestions, >>>> >>>> Regards, Steve >>>> >>>> PS I have the follwing in my .emacs (require 'org-latex) (setq >>>> org-export-latex-listings t) (add-to-list >>>> 'org-export-latex-packages-alist '("" "listings")) (add-to-list >>>> 'org-export-latex-packages-alist '("" "color")) >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ Emacs-orgmode mailing >>>> list Please use `Reply All' to send replies to the list. >>>> Emacs-orgmode@gnu.org >>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode > > >> _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode - -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Natural Sciences Building Office Suite 2039 Stellenbosch University Main Campus, Merriman Avenue Stellenbosch South Africa Tel: +33 - (0)9 53 10 27 44 Cell: +27 - (0)8 39 47 90 42 Fax (SA): +27 - (0)8 65 16 27 82 Fax (D) : +49 - (0)3 21 21 25 22 44 Fax (FR): +33 - (0)9 58 10 27 44 email: Rainer@krugs.de Skype: RMkrug -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkyTL1IACgkQoYgNqgF2egp6VwCgiF0bC1uOTVFKeCr9Q+3S9O/o KnQAn3cBqE6E4NYMUkYJ9esqQGO0GZ1g =5aQ7 -----END PGP SIGNATURE-----