highlight 0.2-0

[This article was first published on Romain Francois, Professional R Enthusiast, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

I’ve released version 0.2-0 of highlight to CRAN

This version brings some more additions to the sweave driver that uses highlight to produce nice looking vignettes with color coded R chunks

The driver gains new arguments boxes, bg and border to control the appearance of the code chunks. When boxes is set to TRUE, the R code chunks are surrounded in boxes, and the arguments bg and border control the background color and the color of the box

Also, when the other highlight is available, the driver will also color code example code in any language that highlight supports. To use this, just surorund the code with <&ltlang=foo&gt> for the language foo. For example:

 <<lang=cpp&gt>=
int main(){
return 0 ;
}
@

will output the content of the code chunk as highlighted c++. The Rcpp-modules vignette in the next version of Rcpp uses both these new features. (see the vignette source in r-forge. The vignette is rendered into latex using :

require(highlight)
driver <- HighlightWeaveLatex(boxes = TRUE)
Sweave( 'Rcpp-modules.Rnw', driver = driver )

To leave a comment for the author, please follow the link and comment on their blog: Romain Francois, Professional R Enthusiast.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)