title: How to add a LaTeX symbol to fig.cap in R markdown?
body: <p>Is there a way to add LaTeX symbols, like infinity <code>\infty</code> to figure captions within R markdown?</p>
  
  <p>I can get LaTeX text formatting to work, but I can't figure out a way to use symbols.</p>
  
  <p>Here is a working example using LaTeX text formatting:</p>
  
  <pre><code>---
  output: 
    pdf_document:
      fig_caption: yes
  ---
  
  ```{r setup, include=FALSE}
  library(knitr)
  opts_chunk$set(
    echo=FALSE,
    message=FALSE,
    warning=FALSE,
    fig.align = 'center'
    )
  ```
  
  ## Testing LaTeX syntax within captions
  
  ```{r pressure, fig.cap="\\label{testPlot}This caption has LaTeX with 
  {\\small small text} and some {\\footnotesize footnote text and 
  \\textbf{bold footnote}} and \\textit{italic}"}
  plot(pressure)
  ```
  </code></pre>
  
  <p>I have tried every combination I can think of an none have worked. For instance, double escape <code>\\infty</code>, brackets <code>{\infty}</code>, double escape within brackets <code>{\\infty}</code>, using the inline LaTeX <code>$\infty$</code>, inline with escape, etc. etc.</p>
  
  <p>Any advice will be greatly appreciated.</p>