R devtools: create both html and pdf of vignettes
Asked Answered
A

1

12

I have written a tutorial in vignette form for one of my packages.

It works fine, but it only creates the html version of the vignette. Is there a way I can create both the html and the pdf version of my vignettes?

I have tried to append rmarkdown::pdf in the output field of my .Rmd file, but it didn't work.

Azobenzene answered 24/11, 2014 at 9:23 Comment(2)
Add all the formats you want to the YAML header (with the "default" one being the first) and do rmarkdown::render("YOUR_RMD_FILE", "all")Edric
how do I add them? In the output field, I do I set two formats?Azobenzene
P
11

This is what I added in the header of my vignette.

output:
  knitr:::html_vignette:
    toc: true
    css: custom.css
    fig_caption: yes
  pdf_document:
    highlight: null
    number_sections: yes

and the I used the command from hrbrmstr above which produces a PDF file.

rmarkdown::render("vignettes/itkr.Rmd", "all")
Polyphyletic answered 31/3, 2016 at 15:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.