highlight 0.2-5

December 7, 2010

(This article was first published on Romain Francois, Professional R Enthusiast, and kindly contributed to R-bloggers)

I pushed highlight 0.2-5 on CRAN. This release improves the latex renderer and the sweave driver so that multiple lines character strings are properly rendered.

This example vignette shows it:


old.op <- options( prompt = " ", continue = " " )

require( inline )
require( Rcpp )
convolve <- cxxfunction( 
    signature( a = "numeric", b = "numeric" ), '
    NumericVector xa(a); int n_xa = xa.size() ;
    NumericVector xb(b); int n_xb = xb.size() ;
    NumericVector xab(n_xa + n_xb - 1,0.0);
    Range r( 0, n_xb-1 );
    for(int i=0; i i++, r++){
        xab[ r ] += noNA(xa[i]) * noNA(xb) ;
    return xab ;
', plugin = "Rcpp" )
convolve( 1:4, 1:5 )

options( old.op )


Once processed with Sweave, e.g. :

require( highlight )
driver <- HighlightWeaveLatex(boxes = TRUE)
Sweave( 'test.Rnw', driver = driver )
texi2dvi( 'test.tex', pdf = TRUE )

we get this result, embedded below with google viewer:

See this question on stack overflow for the tip of using google documents to display pdf files

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 on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags: , ,

Comments are closed.

Search R-bloggers


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)