在rmarkdown中自动编号数字

时间:2019-03-11 09:29:23

标签: r r-markdown knitr

我运行这段代码,但是它没有编号我的身材

## Including Plots

You can also embed plots, for example (Figure \@ref(fig:titanic))

```{r titanic, fig.cap='(ref:titanic)'}
plot(pressure)
```

缺少什么?我需要加载一个我不知道的库吗?情节看起来像这样: enter image description here

我的文件开始如下:

---
title: "Untitled"
output:
  html_document:
    fig_caption: true
---

1 个答案:

答案 0 :(得分:2)

此问题已经here回答。答案列出了解决问题的几种方法,将文档设置为bookdown::html_document2似乎是最简单的解决方案。即修改您的YAML标头:

---
title: "Untitled"
output: bookdown::html_document2
---
相关问题