Processing of Figure Captions in R Markdown
<p><strong>Q:</strong> Can anyone share (or point me to resources) on how the logical processing works for figure captions in R Markdown?</p>

<p><strong>Context:</strong> It took me a long time to figure out how to add LaTeX math into an R Markdown figure caption (see below). I tried: </p>

<ul>
<li><code>\frac{m}{n}</code></li>
<li><code>$\frac{m}{n}$</code></li>
<li><code>\(\frac{m}{m}\)</code></li>
<li><code>\frac{m}{n}</code> </li>
</ul>

<p>before finding the answer <code>$\\frac{m}{n}$</code> <a href="https://stackoverflow.com/questions/37216390/r-markdown-error-resulting-from-math-in-figure-caption">here</a>. I looked through <a href="http://yihui.name/knitr/options/" rel="nofollow noreferrer">this</a> resource but didn't see anything addressing this particular issue. I'm probably missing the bigger picture on how R Markdown works if it took me this long to find my answer. </p>

<pre><code>---
output: 
  pdf_document:
    fig_caption: true
---

```{r, echo=FALSE, fig.cap="hello $\\frac{m}{n}$"}
plot(rnorm(100))
```
</code></pre>

<p><a href="https://i.stack.imgur.com/VypIJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VypIJ.png" alt="enter image description here"></a></p>