[Rcpp-commits] r3416 - pkg/Rcpp/inst/doc/Rcpp-extending

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Dec 18 15:11:34 CET 2011


Author: romain
Date: 2011-12-18 15:11:33 +0100 (Sun, 18 Dec 2011)
New Revision: 3416

Modified:
   pkg/Rcpp/inst/doc/Rcpp-extending/Rcpp-extending.Rnw
Log:
vignette fix

Modified: pkg/Rcpp/inst/doc/Rcpp-extending/Rcpp-extending.Rnw
===================================================================
--- pkg/Rcpp/inst/doc/Rcpp-extending/Rcpp-extending.Rnw	2011-12-18 14:06:33 UTC (rev 3415)
+++ pkg/Rcpp/inst/doc/Rcpp-extending/Rcpp-extending.Rnw	2011-12-18 14:11:33 UTC (rev 3416)
@@ -54,34 +54,6 @@
 linkS4class <- function( cl, package, text = cl, root = "http://finzi.psych.upenn.edu/R/library/" ){
 	link( sprintf("%s-class", cl), package, text, root )
 }
-# this will be integrated to package highlight later
-ex_highlight <- function( file, external.highlight = TRUE, verbatim = FALSE ){
-	if( verbatim ){
-		writeLines( "\\begin{verbatim}" )
-		writeLines( readLines( file ) )
-		writeLines( "\\end{verbatim}" )
-	} else {
-		tf <- tempfile()
-		if( external.highlight ){
-			cmd <- sprintf( 'highlight --input="%s" --output="%s" -L --pretty-symbols', file, tf )
-			tryCatch( {
-				system( cmd )
-				tex <- readLines( tf )
-				keep <- seq( which( tex == "\\noindent" ), which( tex == "\\normalfont" ) )
-				tex <- c(
-					"\\vspace{1em}\\noindent\\fbox{\\begin{minipage}{0.9\\textwidth}" ,
-					tex[ keep ],
-					"\\end{minipage}}\\vspace{1em}" )
-				writeLines( tex )
-			})
-		} else {
-			r = renderer_latex( minipage = TRUE, doc = FALSE )
-			tex <- highlight( file, renderer = r , output = NULL )
-			writeLines( tex )
-		}
-	}
-	invisible(NULL)
-}
 
 require( inline )
 require( Rcpp )
@@ -141,7 +113,7 @@
 writeLines( code, "code.cpp" )
 @
 <<echo=FALSE,results=tex>>=
-ex_highlight( "code.cpp" )
+external_highlight( "code.cpp", type = "LATEX", doc = FALSE )
 @
 
 <<>>=



More information about the Rcpp-commits mailing list