热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

如何在Rmarkdown中将LaTeX符号添加到fig.cap?

如何解决《如何在Rmarkdown中将LaTeX符号添加到fig.cap?》经验,为你挑选了1个好方法。

有没有办法\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)
```

我尝试了所有我能想到的无效组合。例如,double Escape \\infty,方括号,方括号内的{\infty}Double Escape {\\infty},使用嵌入式LaTeX $\infty$,嵌入式Escape等等。

任何建议将不胜感激。



1> Reinstate Mo..:

$\\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)
```


推荐阅读
author-avatar
我喜欢吕继宏
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有