Description: Sweave is combined LaTeX and S code. For more information on Sweave: http://www.ci.tuwien.ac.at/~leisch/Sweave/ http://www.r-project.org/
The highlighting file depends on the syntax highlighting files for LaTeX and R Script, and a big part was borrowed from the LaTeX syntax highlighting file.
This is work in progress - feedback is highly welcome.
Update 2014-06-19: Note that this is abandonware. Please use the revised version at http://kde-files.org/content/show.php?content=165676
I modified this highlight to make possible the highlighting of Sweave code also when it is included in LaTeX math mode. The new highlight is here: http://kde-files.org/content/show.php?content=165676
I made another download in order to have a valid url to link to the AUR PKGBUILD, but if you plan to edit yours I will remove that one.
Thanks a lot. And sorry for not keeping the syntax highlighting up to date. I've been using Emacs with ESS mode since years to work with R/Sweave and hadn't even realised that I once uploaded the syntax highlighting file...
I modified this highlight to make possible the highlighting of Sweave code also when it is included in LaTeX math mode. The new highlight is here: http://kde-files.org/content/show.php?content=165676
Thanks for making your syntax highlighting definitions for Sweave files available!
It would be great if this file could be included into standard KDE/kate(part) packages.
I found a minor bug in the syntax highlighting definitions: if you include an R/S expression in the text that should be evaluated and this expression includes a "$" symbol (e.g. "\Sexpr{x$y}"), all the remaining text is highlighted as if it were in math mode. As a work-around I use currently something like "\Sexpr{x[["y"]]}". However, it would be really great if somebody could fix this.
Thanks,
Arne
Ratings & Comments
5 Comments
I modified this highlight to make possible the highlighting of Sweave code also when it is included in LaTeX math mode. The new highlight is here: http://kde-files.org/content/show.php?content=165676 I made another download in order to have a valid url to link to the AUR PKGBUILD, but if you plan to edit yours I will remove that one.
Thanks a lot. And sorry for not keeping the syntax highlighting up to date. I've been using Emacs with ESS mode since years to work with R/Sweave and hadn't even realised that I once uploaded the syntax highlighting file...
I modified this highlight to make possible the highlighting of Sweave code also when it is included in LaTeX math mode. The new highlight is here: http://kde-files.org/content/show.php?content=165676
Thanks for making your syntax highlighting definitions for Sweave files available! It would be great if this file could be included into standard KDE/kate(part) packages. I found a minor bug in the syntax highlighting definitions: if you include an R/S expression in the text that should be evaluated and this expression includes a "$" symbol (e.g. "\Sexpr{x$y}"), all the remaining text is highlighted as if it were in math mode. As a work-around I use currently something like "\Sexpr{x[["y"]]}". However, it would be really great if somebody could fix this. Thanks, Arne
I was looking for this, after couple of days of switching between R and LaTeX highlighting for my paper, thank you!