emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sébastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: Color of exported R code results using LaTeX listings
Date: Sat, 18 Sep 2010 09:10:15 +0200	[thread overview]
Message-ID: <87bp7v1q94.fsf@mundaneum.com> (raw)
In-Reply-To: 1284777581.3782.17.camel@sduofa-desktop

Hi Steven,

Steven Delean wrote:
> Thanks again for all your assistance. I was not able to achieve the results
> 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=\color{blue},
> #+LATEX_HEADER:         commentstyle=\color{red},
> #+LATEX_HEADER:         stringstyle=\color{green},
> #+LATEX_HEADER:         basicstyle=\ttfamily\small,
> #+LATEX_HEADER:         columns=fullflexible,
> #+LATEX_HEADER:         basewidth={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=
> \small,formatcom = {\color[rgb]{0.5,0,0}}}

What about if your results block is an Org table, instead of verbatim?

Best regards,
  Seb

-- 
Sébastien 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

      reply	other threads:[~2010-09-18  7:10 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-17  7:31 Color of exported R code results using LaTeX listings Steven Delean
2010-09-17  8:00 ` Rainer M Krug
2010-09-17  8:28   ` Steven Delean
2010-09-17  8:52     ` Sébastien Vauban
2010-09-17  9:13       ` Rainer M Krug
2010-09-17 13:14         ` Steven Delean
2010-09-17 13:20           ` Rainer M Krug
2010-09-17 13:30             ` Sébastien Vauban
2010-09-17 14:15               ` Rainer M Krug
2010-09-17  9:05     ` Rainer M Krug
2011-01-04 10:06       ` Bastien
2010-09-17 12:24 ` Eric Schulte
2010-09-18  2:39   ` Steven Delean
2010-09-18  7:10     ` Sébastien Vauban [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bp7v1q94.fsf@mundaneum.com \
    --to=wxhgmqzgwmuf-genee64ty+gs+fvcfc7uqw@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).