Using a Static (Prebuilt) PDF Vignette in R Package

Using a static (prebuilt) PDF vignette in R package

With R.rsp (>= 1.19.0) you can include a static PDF 'vignettes/main.pdf' by adding a tiny 'vignettes/main.pdf.asis' text file that contains:

%\VignetteIndexEntry{My amazing package}
%\VignetteEngine{R.rsp::asis}

and make sure to have:

Suggests: R.rsp
VignetteBuilder: R.rsp

in your package's DESCRIPTION file. This also works for static HTML vignettes. This is also explained in one of the R.rsp vignettes.

Can I have R vignette with a pre-compiled PDF with manual index.html show up the vignette list?

Right after Yihui....

Make a fake Rnw that looks like this:

%\VignetteIndexEntry{User manual}
\documentclass{article}
\begin{document}
\end{document}

And put it in inst/doc along side your precompiled vignette and you will be all set.

How do I 'prebuild' a vignette index for an R package?

I gather the Vignette commands need to be in the preamble, i.e. below documentclass, so that the file myVignette.Rnw should read:

\documentclass{article}

% \VignetteIndexEntry{myVignette}
% \VignetteEngine{knitr::knitr}

\usepackage[]{graphicx}
...

This seems to work fine.

The error message is from the development version of R CMD check which is currently 3.3.0. I have been using the older 'stable' version which is not the recommended way to check packages when considering submission to CRAN.

I'm still not sure of the merits of using a manual index.html file - it appears unnecessary but I will gladly change the accepted answer if anyone can throw some light on this.



Related Topics



Leave a reply



Submit