1

I have a series of .png images that I would like to add notes to in an Rmarkdown document that I am knitting to a .pdf. The basic code for each image looks like this:

```{r certs_coefplot, out.width="100%", fig.cap=fig.4_cap}
knitr::include_graphics("certs_coefplot.png")
```

With beamer slides, I have just inserted some basic latex like this:

\tiny \emph{Notes}: Put Notes here \normalsize

below each code chunk.

But if I try this in the context of a larger document, the notes do not appear below the figure.

A solution involving a custom hook was proposed to a similar question asked here about adding notes to figures in an .Rnw file. In particular, the version where you put the code for the hook at the beginning and then write:

notes = "Notes to explain the plot"
sources = "Explain the sources"

in each chunk seems really convenient.

Is it possible to apply a similar solution an RMarkdown file?

0 Answers0