#139 Embedded R code in Sweave (.Rnw) corrupts syntax highlight

v0.2
open
5
2010-10-13
2010-10-13
Anonymous
No

Hello,
GREAT plugin!!

While using Gedit-LaTeX-plugin, I embed some R code as "Sweave" code in the .Rnw document. Generally, the highlighting is appropriately as LaTeX. However, the embedded code (in the "noweb" format) throws off the syntax highlighting of the remaining LaTeX code. For example, the following line of R code (which uses the '$' to access items in a list) ends up highlighted as if it were LaTeX code, and messes up following LaTeX code after the embedded section. Is there a way to make the code within the << >>= and @ use a different (R) highlighting scheme? Or simply ignore it?

<<echo=FALSE, term=FALSE>>=
l$sigma2 <- c( exp(logsigma2.tmp) ) # assume the first sigma2 is always 1.
@

Thanks!!

Discussion