I've just started using Sweave on TeXShop ( which runs on OSX). Is it possible to have syntax coloring of the source code so that I can distinguish between raw text and R-code?
For example, the following code snippet in my Sweave file is the same as the rest of the text, which makes it harder to read than an R editor that has syntax coloring.
<<reg, fig=TRUE, echo=FALSE>>=
a = c(10,15)
plot(a, a)
@
(I have also tried this out using the wonderful RStudio which does have syntax coloring for both R and Latex, but I think TexShop is superior for LaTeX.)
highlight
package. It can produce LaTeX output. – aL3xapgfSweave
- take a look at my answer bellow. – aL3xa