Is there a way to add LaTeX symbols, like infinity \infty to figure captions within R markdown?
I can get LaTeX text formatting to work, but I can't figure out a way to use symbols.
Here is a working example using LaTeX text formatting:
---
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)
```
I have tried every combination I can think of an none have worked. For instance, double escape \\infty, brackets {\infty}, double escape within brackets {\\infty}, using the inline LaTeX $\infty$, inline with escape, etc. etc.
Any advice will be greatly appreciated.