Is there a way (method, global variable, option) to find out within an rmarkdown document to which format (pdf or html) it is being rendered?
Asked
Active
Viewed 14 times
0
-
The output type has to be specified in the YAML header under "output:" – Allan Cameron Feb 07 '20 at 14:43
-
2@AllanCameron yes---and the same document may be knit to multiple formats, in which case you may need your code to do different things depending on the current output format. So you need a programmatic way for your code to know the output format. – Gregor Thomas Feb 07 '20 at 14:45