【问题标题】:knitr: Using subscript with fig.cap in Markdownknitr:在 Markdown 中使用带有 fig.cap 的下标
【发布时间】:2021-07-18 05:05:26
【问题描述】:

使用{r fig.cap=""}时如何在图形标题中包含下标?

模拟 .Rmd 文件:

---
output:
  pdf_document:
    fig_caption: yes
---

```{r setup, include = FALSE}
library(knitr)
```{r fig.cap = "CO2 Concentration", echo = FALSE}
plot(rnorm(100))

我想得到 2 in CO2 的下标。 fig.cap 是最好的方法,还是更好的方法?

【问题讨论】:

    标签: r r-markdown knitr


    【解决方案1】:

    你可以使用标准的Markdown syntax

    ---
    output:
      pdf_document:
        fig_caption: yes
    ---
    
    This is ^superscript^  
    This is ~subscript~
    
    ```{r fig.cap = 'CO~2~ Concentration', echo = FALSE}
    plot(rnorm(100))
    ```
    

    【讨论】:

    • 我不知道这是一个标准的东西!谢谢!..您的回答和参考!
    猜你喜欢
    • 2013-11-05
    • 2013-09-28
    • 1970-01-01
    • 1970-01-01
    • 2012-08-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多