Home > Back-end >  R Markdown: add a frame to an inserted figure
R Markdown: add a frame to an inserted figure

Time:12-14

I am writing a report.pdf in R Markdown and want to include a pdf as a figure. The chunk looks like this:

include_graphics("path/to/figure.pdf")

The chunk works fine, but since the figure has a white margin, it is not clear on the output page where the figure starts/ends. Therefore, I would like to add a simple frame around the figure. Does knitr provide that option?

I've looked for similar questions on rseek.org, scanned through Yihui's book on bookdown and searched the knitr package documentation without finding anything helpful.

CodePudding user response:

Following this enter image description here

  • Related