@ChristianL,
you already referred to https://forum.posit.co/t/adding-alt-text-to-figures-generated-in-r-markdown/65191. I am afraid that that is the way to go until the knitr
package is changed: you would have to change the knit hook
for the plot.
While that is not so difficult to do (the reference shows how in the case of a Hugo
document) the problem lies more in handling correctly all the different cases.
Therefore I suggest you do a request in the knitr
GitHub repository .