R Markdown HTML Number Figures
<p>Does anyone know how to number the figures in the captions, for HTML format R Markdown script?</p>

<p>For PDF documents, the caption will say something like:</p>

<blockquote>
  <p>Figure X: Some Caption Text</p>
</blockquote>

<p>However, the equivalent caption for the HTML version will simply say:</p>

<blockquote>
  <p>Some Caption Text</p>
</blockquote>

<p>This makes cross-referencing figures by number completely useless.</p>

<p>Here is a minimal example:</p>

<pre><code>---
title: "My Title"
author: "Me"
output:
  pdf_document: default
  html_document: default
---

```{r cars, fig.cap = "An amazing plot"}
plot(cars)
```


```{r cars2, fig.cap = "Another amazing plot"}
plot(cars)
```
</code></pre>

<p>I have tried setting <code>toc</code>, <code>fig_caption</code> and <code>number_sections</code> within each of the output formats, but this does not seem to change the result.</p>