How do I automatically number images in html using R Markdown?

Viewed 105

I am using R Markdown to create a long html document with multiple images inserted throughout. I need automatically numbered figure captions, but cannot figure out how to generate them.

I insert figures this way:

![An informative figure caption](path.png)

The YAML metadata looks like this:

title: "My Title"
author: "me"
bibliography: References.bibtex
output: 
  bookdown::html_document2:
  number_sections: TRUE
  fig_caption: TRUE
0 Answers
Related