baptiste auguie
2010-Aug-13 09:01 UTC
[R] cacheSweave / pgfSweave driver for package vignette
Dear list, I wish to use a specific driver to process an sweave document in the inst/doc directory of a package. Specifically, I would like to use either cacheSweave or pgfSweave to speed up the creation of the vignette which requires lengthy computations. The same request would also apply to the highlight driver, to provide syntax highlighting of R chunks. In "writing R extensions" I see that during R CMD BUILD Sweave is run first, then optionally a makefile can be used to process any other files. It doesn't seem to leave room for a choice of Sweave engine, as far as I understand. One option I am thinking of is to change the extension of the source file to something like .Rnw2 so that Sweave ignores it altogether, and then use the appropriate command in a makefile. I have no experience in writing makefiles, so I'm hoping someone would already have solved this issue and could provide some advice. Sincerely, baptiste
Romain Francois
2010-Aug-13 09:10 UTC
[R] cacheSweave / pgfSweave driver for package vignette
Hi, I've been meaning to ask the same question before. Le 13/08/10 11:01, baptiste auguie a ?crit :> > Dear list, > > > I wish to use a specific driver to process an sweave document in the > inst/doc directory of a package. Specifically, I would like to use > either cacheSweave or pgfSweave to speed up the creation of the > vignette which requires lengthy computations. The same request would > also apply to the highlight driver, to provide syntax highlighting of > R chunks. > > In "writing R extensions" I see that during R CMD BUILD Sweave is run > first, then optionally a makefile can be used to process any other > files. It doesn't seem to leave room for a choice of Sweave engine, as > far as I understand. One option I am thinking of is to change the > extension of the source file to something like .Rnw2 so that Sweave > ignores it altogether, and then use the appropriate command in a > makefile.This is what we do in Rcpp to build our 7 vignettes (since we like to use the driver from highlight). One thing to have in mind is that R needs the .Rnw file to be present in doc once the package is installed, so that the vignette function works, hence some trickery in Rcpp. A way to control which sweave (and perhaps tangle) driver is to be used for a particular vignette would be very useful. Romain> I have no experience in writing makefiles, so I'm hoping someone would > already have solved this issue and could provide some advice. > > Sincerely, > > baptiste-- Romain Francois Professional R Enthusiast +33(0) 6 28 91 30 30 http://romainfrancois.blog.free.fr |- http://bit.ly/b8VNE2 : Rcpp at LondonR, oct 5th |- http://bit.ly/aAyra4 : highlight 0.2-2 `- http://bit.ly/94EBKx : inline 0.3.6
Gabor Grothendieck
2010-Aug-13 09:30 UTC
[R] cacheSweave / pgfSweave driver for package vignette
On Fri, Aug 13, 2010 at 5:01 AM, baptiste auguie <baptiste.auguie at googlemail.com> wrote:> Dear list, > > > I wish to use a specific driver to process an sweave document in the > inst/doc directory of a package. Specifically, I would like to use > either cacheSweave or pgfSweave to speed up the creation of the > vignette which requires lengthy computations. The same request would > also apply to the highlight driver, to provide syntax highlighting of > R chunks. > > In "writing R extensions" I see that during R CMD BUILD Sweave is run > first, then optionally a makefile can be used to process any other > files. It doesn't seem to leave room for a choice of Sweave engine, as > far as I understand. One option I am thinking of is to change the > extension of the source file to something like .Rnw2 so that Sweave > ignores it altogether, and then use the appropriate command in a > makefile. > > I have no experience in writing makefiles, so I'm hoping someone would > already have solved this issue and could provide some advice. >If its just a matter of running the vignette offline then the Ryacas package uses an approach which does not require a special driver and is simple enough that it does not really require make files. See Ryacas.Rnw in the source: http://code.google.com/p/ryacas/source/browse/#svn/trunk/inst/doc