有没有办法添加LaTeX符号,如infinity \infty
来标记R markdown中的字幕?
我可以让LaTeX文本格式化工作,但我无法找到使用符号的方法。
以下是使用LaTeX文本格式的工作示例:
---
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)
```
我已经尝试了我能想到的每一个组合都没有效果。例如,双重逃脱\\infty
,括号{\infty}
,括号{\\infty}
内的双重逃脱,使用内联LaTeX $\infty$
,内联逃生等。
任何建议将不胜感激。
$\\infty$
的作品。你需要逃离\
和IIRC中的\infty
,这是一个数学模式符号,所以你也需要调用它。
```{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} and $\\infty$"}
plot(1:10)
```