Sub*_*iaN 4 latex r r-markdown
有没有办法\infty在R markdown内添加LaTeX符号(如无穷大图形)到图形标题?
我可以使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)
```
Run Code Online (Sandbox Code Playgroud)
我尝试了所有我能想到的无效组合。例如,double Escape \\infty,方括号,方括号内的{\infty}Double Escape {\\infty},使用嵌入式LaTeX $\infty$,嵌入式Escape等等。
任何建议将不胜感激。
$\\infty$作品。您需要转义\in \infty和IIRC,这是一个数学模式符号,因此也需要调用它。
```{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)
```
Run Code Online (Sandbox Code Playgroud)