Closed maxheld83 closed 6 years ago
As mentioned in https://github.com/rstudio/bookdown/issues/316, I don't think I'll ever have the time to implement this and personally I don't have much interest in it, so I'd say you have to do it by yourself if you really want it. The knitr hook system is fairly open. Thanks for the suggestion, though.
This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.
It appears to me that upstream uses of
knitr
, especially when they are outputting to HTML such asbookdown
(this issue) andblogdown
(this issue might require several resolution versions of bitmap assets, for example to support responsive images (say, download a different filesize depending on the viewport).I think this is not presently possible, hope I am not wrong. Unfortunately, I am a little bit confused of how or where (in
knitr
?) this could be implemented, but I hope it's at least a worthwhile thought.Perhaps,
knitr
could learn to accept a vector of resolutions fordpi
, and then upstream functions such asblogdown
orbookdown
could supply reasonable default sets of DPIs, to whichknitr
could render?Ps.: There is also a more limited use case for this when non-R raster images are included via
include_graphics()
. When the bitmap is large, we might want quite different resolutions for a PDF output, and an HTML output, where load times matter more. This would require re-sizing in R as per this issue, and is probably a really niche use case.