HTML and pdf vignette reasonable?

Does it makes sense (or is it even possible) to release an html as well as a pdf version of the vignette of a package?

I've managed for the Rmd file to output an HTML and pdf document the way I want it to. While the pdf version is more "fixed" and better for citation purposes, I find the HTML to be easier to navigate and read, especially when it comes to the code examples. If I had to choose one version though, I'd go with pdf. Optimally I'd like to keep both.

I don't see why not.

Hmm... I don't quite see how though. Did I understand the package release process wrong? I thought vignettes were built automatically such that I'd have to specify somewhere if I wanted to do something out of the norm. Or is everything within the doc/ folder considered a vignette of some sort?

I think, I'm asking exactly what this person is asking: knitr - How do I produce R package vignettes in multiple formats? - Stack Overflow

Just noting that for accessibility (e.g. for screenreader users), html vignettes are much better than PDF vignettes.

Now, regarding the vignette building, you could pre-build some of them. Optimal workflows for package vignettes - R-hub blog

1 Like

Thanks! I went with Mark van der Loo's answer, prebuilt the pdf vignette, saved it under vignettes/prebuilt.pdf and included it in vignettes/mypackage_pdf.Rnw:

%\VignetteIndexEntry{Using my package pdf version}

\includepdf[pages=-, fitpaper=true]{prebuilt.pdf}

I'll just have to remember to repeat the build and copy steps in the future :stuck_out_tongue:

1 Like

Cool! To remember doing something before a package release, you can use arelease_bullets() internal function, granted you use usethis::use_release_issue() to create a checklist for each release.

release_bullets <- function() {
  c("Update PDF vignette.")
1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.