[R-pkg-devel] VignetteBuilder field

Dirk Eddelbuettel edd @end|ng |rom deb|@n@org
Wed Jul 3 20:07:13 CEST 2019


On 3 July 2019 at 19:43, Michael Gruenstaeudl wrote:
| Assume an R package `myPackage` that contains the folder `vignettes`, in 
| which the TEX-file `PACViR_Vignette.tex` and two image files 
| (`image1.pdf` and `image2.pdf`) are located. The TEX-file compiles 
| nicely without the need to use Sweave or knitr.
| 
| Upon testing the package for submission to CRAN via `R CMD check PACViR 
| --as-cran`, I receive the following NOTES, which appear to prevent CRAN 
| from accepting my package:
| 
| 
| Flavor: r-devel-windows-ix86+x86_64
| Check: files in 'vignettes', Result: NOTE
|    Package has no Sweave vignette sources and no VignetteBuilder field.
| 
| Flavor: r-devel-linux-x86_64-debian-gcc
| Check: files in ‘vignettes’, Result: NOTE
|    Package has no Sweave vignette sources and no VignetteBuilder field.
| 
| What is needed to address this issue? Do I need to specify a 
| `VignetteBuilder` somewhere?

Your mental model may be that any suitable latex or tex file will pass for a
vignette.  But that is not how it works.

Luckily it is both easy to turn your .tex into an .Rnw, and that should be
all you need.  Ie something like 

  \documentclass{article}
  %\VignetteIndexEntry{SOMETHING OR OTHER HERE}
  %\VignetteKeywords{HERE TOO}
  %\VignettePackage{HERE TOO}
  %\VignetteEncoding{UTF-8}

  \begin{document}

  % your latex code here

  \end{document}

save as vignette/my_package_vignette.Rnw is all it takes. You can add latex
commands to the header as usual, and can do just about anything the document
part.  Including weaving R code.  But you don't have too.  Fully static work.

You can also go a third way and pre-render your vignette and then have a
minimal file slurping it in. Mark described that here:

  http://www.markvanderloo.eu/yaRb/2019/01/11/add-a-static-pdf-vignette-to-an-r-package/

and I am doing that in a few packages as I was getting bored of having to see
builds or checks randomly fail if some semi-common tex files or styles were
missing.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | edd using debian.org



More information about the R-package-devel mailing list