tests/testthat/examples/knitr-examples/120-figure-alt-text.md

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

By default, the caption will be used

plot(1:10)

A caption

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

plot(1:10)
An alternative text

A caption

It will be evaluated after the chunk like fig.cap

n <- 15
plot(1:n)
A graph with 15 points

15 points

And recycled if several graphs

plot(1:15)
An alternative text

A caption

plot(1:10)
An alternative text

A caption

or you can pass a vector

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

Fig1



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.