I use pgfSweave so that I can embed R code and output in LaTeX;
pgfSweave depends on the formatR package to format the code, and the highlight
package to highlight R code; graphics are based on tikzDevice, which has better
quality than R's PDF or postscript output, in my opinion.
Check out the developer's page here:
http://yihui.name/en/2011/05/sweave-and-pgfsweave-in-lyx-2-0-x-experimental/ abd
http://www.r-bloggers.com/how-to-start-using-pgfsweave-in-lyx-in-one-minute/
________________________________
From: Giovanni Azua <bravegag@gmail.com>
To: r-help@r-project.org
Sent: Wednesday, November 23, 2011 9:33 AM
Subject: [R] R-latex syntax highlighting?
Hello,
Can anyone provide or point me to a good setup for the listings latex package
that would produce nice R-syntax highlighting?
I am using an example I found in internet for setting up listings like this:
\lstset{
language=R,
basicstyle=\scriptsize\ttfamily,
commentstyle=\ttfamily\color{gray},
numbers=left,
numberstyle=\ttfamily\color{red}\footnotesize,
stepnumber=1,
numbersep=5pt,
backgroundcolor=\color{white},
showspaces=false,
showstringspaces=false,
showtabs=false,
frame=single,
tabsize=2,
captionpos=b,
breaklines=true,
breakatwhitespace=false,
title=\lstname,
escapeinside={},
keywordstyle={},
morekeywords={}
}
But I know that using the color latex package it can look a lot nicer and I
guess some people might have configured that before and are willing to share it?
I'm also interested in the a similar problem best way to put R code with
syntax highlighting into a presentation. I use Apple's Keynote.
Many thanks in advance,
Best regards,
Giovanni
[[alternative HTML version deleted]]
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
[[alternative HTML version deleted]]