title: cross-reference to figure in R Markdown with html output is not working
body: <p>I would like to show a nice cross-reference to a picture in the HTML document I'm creating with R Markdown. However, even if I followed <a href="https://bookdown.org/yihui/bookdown/cross-references.html" rel="nofollow noreferrer">the bookdown section on cross-references</a>, I cannot get the reference to show in the final HTML output. I'm working in R Studio, if that helps. .Rmd file:</p>
  
  <pre><code>---
  title: "ppp"
  author: "ppp"
  date: "July 4, 2017"
  output: 
    html_document: 
      fig_caption: yes
  ---
  
  ```{r setup, include=FALSE}
  library(knitr)
  opts_chunk$set(echo = FALSE)
  ```
  
  
  ```{r foo, fig.cap="$f_{p}$ as a function of $g$ for various values of $r=\\frac{\\rho_{w}}{\\rho_{a}}$"}
  # All defaults
  include_graphics("download.jpg")
  ```
  
  A cross-reference to figure \@ref(fig:foo).
  </code></pre>
  
  <p>The output I get is</p>
  
  <p><a href="https://i.stack.imgur.com/waxxG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/waxxG.png" alt="enter image description here"></a></p>
  
  <p>So the caption is rendering correctly, but the cross-reference is not being created. How do I fix that?</p>