From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: Re: Color of exported R code results using LaTeX listings Date: Sat, 18 Sep 2010 09:10:15 +0200 Message-ID: <87bp7v1q94.fsf@mundaneum.com> References: <1284708719.2732.28.camel@sduofa-desktop> <87k4mk5uji.fsf@gmail.com> <1284777581.3782.17.camel@sduofa-desktop> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: 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-mXXj517/zsQ@public.gmane.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Steven, Steven Delean wrote: > Thanks again for all your assistance. I was not able to achieve the resul= ts > I was after exactly using any proposed solutions, but have found a way > forward and outline my solution below in case it benefits others. > > The following allows fontification and syntax highlighting for source code > and a single color for exported output, and works both for latex documents > and beamer slides. > NB: A single color for source code in exported documents can be acheived = by > adding e.g. \color{blue} to basicstyle. > > 1. The following must appear in your .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")) > > 2. Add the following to your .org document header to allow colors and > 'nice' font > #+LATEX_HEADER: \lstset{ > #+LATEX_HEADER: keywordstyle=3D\color{blue}, > #+LATEX_HEADER: commentstyle=3D\color{red}, > #+LATEX_HEADER: stringstyle=3D\color{green}, > #+LATEX_HEADER: basicstyle=3D\ttfamily\small, > #+LATEX_HEADER: columns=3Dfullflexible, > #+LATEX_HEADER: basewidth=3D{0.5em,0.4em} > #+LATEX_HEADER: } > > 3. Also add the following to your .org document header to allow the > output results of evaluating R (or other language) code to be in color > #+LATEX_HEADER: \RequirePackage{fancyvrb} > #+LATEX_HEADER: \DefineVerbatimEnvironment{verbatim}{Verbatim}{fontsize=3D > \small,formatcom =3D {\color[rgb]{0.5,0,0}}} What about if your results block is an Org table, instead of verbatim? Best regards, Seb --=20 S=C3=A9bastien Vauban _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode-mXXj517/zsQ@public.gmane.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode