When a figure size is set using the out.width/out.hight chunk option, or indirectly using fig.retina, the resulting figure is rendered in the intermediate markdown file with an <img> tag, which Pandoc ignores when converting to word. This differs from the behaviour of word_document and would be very useful in redoc.
Unfortunately I am not well versed enough in the rmarkdown internals to suggest a fix, but a hint might be in this knitr PR which made these chunk options effective in docx formats: yihui/knitr#1746
It seems the cause of this is the pandoc option to = "docx+empty_paragraphs" in redoc.R, which is not in the list of to values that trigger the use of a knitr hook.
When a figure size is set using the out.width/out.hight chunk option, or indirectly using fig.retina, the resulting figure is rendered in the intermediate markdown file with an
<img>tag, which Pandoc ignores when converting to word. This differs from the behaviour of word_document and would be very useful in redoc.fig_sizing_reprex_redoc.docx
fig_sizing_reprex_word.docx
Unfortunately I am not well versed enough in the rmarkdown internals to suggest a fix, but a hint might be in this knitr PR which made these chunk options effective in docx formats: yihui/knitr#1746
Session Info
Pandoc version (get with rmarkdown::pandoc_version): 2.7.3
RStudio version (if applicable): 1.3.885
rmarkdown version: 2.1
knitr version: 1.28
The text was updated successfully, but these errors were encountered: