[Rd] vignettes present in 2 folders or won't work

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Sun Nov 1 18:19:09 CET 2020


You are doing a lot of things that are non-standard, so I doubt if 
anyone is going to be able to help you without access to a simple 
reproducible example of a package that does what you do.  Try to cut out 
as much as you can to make it minimal.  For example, 
devtools::document() (indeed, most of your code) is probably irrelevant 
to your problem with vignettes, but things like your .Rbuildignore file 
are not.

Duncan Murdoch

On 01/11/2020 11:22 a.m., Alexandre Courtiol wrote:
> Dear all,
> 
> I am struggling with an issue related to static vignettes: they work, but
> only when present in double in the tarball -- in the folder inst/doc and
> vignettes; see below for details.
> 
> Details:
> 
> I am pre-compiling heavy vignettes thanks to the vignette builder R.rsp.
> So basically, I have PDF files which I want the package to use as Vignettes.
> 
> For this, I have the following in my Description file:
> VignetteBuilder: R.rsp
> 
> I am organising the vignette by hand using a Makefile (because this is the
> only way that has proven 100% reliable to me, across a variety of
> situations).
> 
> In my Makefile, I have something like:
> 
> build: clean
>    mkdir -p inst/doc
>    mkdir vignettes
>    -cp sources_vignettes/*/*.pdf* vignettes
>    Rscript -e "tools::compactPDF(paths = 'vignettes', gs_quality =
> 'printer')"
>    cp vignettes/*.pdf* inst/doc
>    Rscript -e "devtools::document()"
>    mkdir inst/extdata/sources_vignettes
>    cp sources_vignettes/*/*.Rnw inst/extdata/sources_vignettes
>    Rscript -e "devtools::build(vignettes = FALSE)"
> 
> That works fine, the vignettes show up using browseVignettes() after
> installing the package the normal way.
> 
> However, after building, the tar.gz contains each pdf corresponding to a
> vignette twice: once in vignettes and once in inst/doc (which is obvious,
> when reading the Makefile).
> 
>  From the reading of "Writing R Extensions" and other material, I cannot
> tell if that is a must or not, but I hope it is not since I wish to avoid
> that (my pdfs are large even once compressed).
> 
> My problem is that when I delete either inst/doc or vignette just before
> calling the last command of the Makefile (Rscript -e
> "devtools::build(vignettes = FALSE)"), then browseVignettes() does not find
> the vignettes after a normal installation.
> 
> If anyone knows of some _complete_ documentation about the ever troublesome
> topic of vignettes building in R, I would be very grateful too...
> 
> Many thanks!
> 
> Alex
>



More information about the R-devel mailing list