gented
gented

Reputation: 1687

Package has a VignetteBuilder field but no prebuilt vignette index

I am submitting a package to CRAN and I have got the below warning from the reviewers team:

Package has a VignetteBuilder field but no prebuilt vignette index.

that I have in fact seen also when running devtools::release(). I am using the last R version as R version 3.3.1 and have the following .Rmd vignette source:

---
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{<my vignette title>} 
  %\VignetteEngine{knitr::knitr}
  %\usepackage[utf8]{inputenc}
--- 

Moreover, I have included knitr in the DESCRIPTION file as per default:

Suggests:
    knitr
VignetteBuilder:
    knitr

I have looked around and, although the issue seems to be quite common, I have not been able to understand why the index does not build (and how to force build it).


This question and links therein are the top google results but do not solve the problem.

Upvotes: 13

Views: 2530

Answers (2)

Magnus
Magnus

Reputation: 25774

I had the exact same error. I made the following changes to my package, which had been suggested before, but some in comments, and not with clear verification about what worked and what did not.

First, I made changes to the vignette: specification in the header so that it now reads as follows (note the difference in the encoding specification line, from %\usepackage[utf8]{inputenc} to %\VignetteEncoding{UTF-8}, which matches the directions in https://bookdown.org/yihui/rmarkdown/r-package-vignette.html which seem to have changed)

vignette: >
  %\VignetteIndexEntry{The import package}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}

Without these changes I had problems where I would either get warnings locally or remotely, but this made things more consistent.

Second, and potentially most important, I removed ^build from my .Rbuildignore, importantly, devtools did not add it back, so I wonder if this is some legacy behavior or if I potentially added it myself at some point. I did not remove ^Meta (I tried but devtools added the ignore back).

These changes resolved the note consistently and the package is now released :-)

Upvotes: 1

This requires a build/vignettes.rds or Meta/vignettes.rds file. This file is automatically generated by devtools. Please make sure that you do not delete it or list it in .Rbuildignore (check for a line containing build Meta or ^build/vignettes.rds$ ^Meta/vignettes.rds$ and delete it from the file).

Upvotes: 3

Related Questions