1

I'm confused as to why my R package's vignette is in HTML on CRAN and not a pdf.

I followed the advice at Enforce PDF package vignette with knitr and used

%\VignetteEngine{knitr::rmarkdown}

to generate the vignette, but there it is, a pdf. The full header of one of the files is

---
title: "wCorr Formulas"
author: "Paul Bailey, Ahmad Emad, Ting Zhang, Qingshu Xie"
date: '`r Sys.Date()`'
output:
  pdf_document: default
vignette: |
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteIndexEntry{wCorr Formulas}
  \usepackage[utf8]{inputenc}
  \usepackage{amssymb}
---

you can see the whole package at https://github.com/cran/wCorr or, before it gets built at https://github.com/ahmademad/wCorr

pdb
  • 1,574
  • 12
  • 26

1 Answers1

3

You are including copies of the HTML output (presumably from an earlier version) in inst/doc.

This might not have been intentional; I believe devtools::build_vignettes might do it to work around a bug in R: https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=17416. But there are better workarounds, e.g. described here: https://github.com/yihui/knitr/issues/1540 .

user2554330
  • 37,248
  • 4
  • 43
  • 90
  • those are added when building the package, they aren't present in the package when it gets built. I added a link in the OP to the package before it is built. – pdb May 22 '18 at 22:15
  • Nevertheless, you put them there. Use the standard build tool (i.e. R CMD build) and you won't get them unless you ask for them. – user2554330 May 23 '18 at 00:05
  • I use "R CMD build" at the command line. I'd never used "devtools::build_vignettes" until you mentioned it here. – pdb May 23 '18 at 04:22
  • The version on CRAN is 1.9.1; the one on Github is 1.9.0. When I build the one on Github I don't get the HTML files, but the CRAN one has them. You should check the tarball that you sent to CRAN with 1.9.1 in it: I suspect (for whatever reason) it contains the HTML files. – user2554330 May 23 '18 at 11:58
  • Yes, I suspect the same. I now think it is that I didn't have my environment setup correctly to build pdf files, so R CMD build didn't build them. Then, CRAN posted what I sent--which makes sense. – pdb May 23 '18 at 14:44