knitr::opts_chunk$set(dev = 'svg')
# simulate pandoc html output
knitr::opts_knit$set(rmarkdown.pandoc.to = "html")

An alternative text will always be provided with an image tag in html.

By default, the caption will be used

plot(1:10)

You can use an alt text different than a caption using fig.alt

plot(1:10)

It will be evaluated after the chunk like fig.cap

n <- 15
plot(1:n)

And recycled if several graphs

plot(1:15)
plot(1:10)

or you can pass a vector

plot(1:15)
plot(1:10)


Try the parsermd package in your browser

Any scripts or data that you put into this service are public.

parsermd documentation built on Aug. 21, 2025, 5:27 p.m.