3
votes

Let's say I have a long report that produces a lot of figures which knitr makes as pdfs and it works really well with LaTeX. At the end of the project, my co-authors would like to have also raster based figures. One option would be to convert everything using ImageMagick. Another option would be to specify for each chunk dev = c("jpg", "pdf"), but given the number of figures, this could be cumbersome.

Is there a global switch to make knitr produce figures in pdf and other formats at the same time?

1

1 Answers

5
votes

I think in the preamble

opts_chunk$set(dev = c("pdf", "jpg"))

should do. Within a R-chunk of course.