Package has a VignetteBuilder field but no prebuilt vignette index
Asked Answered
G

2

13

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.

Gyro answered 22/9, 2016 at 21:26 Comment(4)
Do you have no title? And the last line is sometimes %VignetteEncoding{UTF-8} or just \usepackage[utf8]{inputenc}Radioscopy
The title is there (I just didn't include it in the question body) and so is the %VignetteEncoding{UTF-8}. I suppose the problem is elsewhere, it must be in the building properties or the like.Gyro
I have had the same answer. What was your solution ?Usa
You might want to check your .Rbuildignore. For me the issue was that I had build included there, which you should not do.Setose
P
3

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).

Priapitis answered 17/7, 2020 at 1:51 Comment(1)
devtools puts those ignores in there. Are you saying that we should remove every time what devtools puts into Rbuildignore?Undersexed
M
1

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 :-)

Media answered 25/9, 2023 at 11:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.