Using a static (prebuilt) PDF vignette in R package

后端 未结 3 959
Happy的楠姐
Happy的楠姐 2020-12-05 14:16

What is the proper way, to include a static PDF file as a \"vignette\" in a CRAN package as of R 3.0?

The trick described in this document of using an empty stub

3条回答
  •  眼角桃花
    2020-12-05 14:41

    This works with a plain LaTeX trick as described in in this blog post.

    I recently switched to doing this with the current R version (i.e. now 3.6.0), see this wrapper .Rnw file which contains just:

    \documentclass{article}
    \usepackage{pdfpages}
    %\VignetteIndexEntry{Using Annoy in C++}
    %\VignetteKeywords{Rcpp, Annoy, R, Cpp, Approximate Nearest Neighbours}
    %\VignettePackage{RcppAnnoy}
    
    \begin{document}
    \includepdf[pages=-, fitpaper=true]{UsingAnnoyInCpp.pdf}
    \end{document}
    

    The advantage is that this uses Sweave for a completely traditional vignette build, and imposes no additional dependencies whatsover.

提交回复
热议问题