使用bookdown(单个文档(时,如果同时设置了section_numbering = 'yes'
和fig_caption = 'yes'
,则数字编号为X.2
(其中X
是节号(。如果section_number = 'no'
,则图形按顺序编号(图1、2…(,但节号丢失。
有没有一种方法可以在不丢失章节编号的情况下按顺序编号数字?在下面的例子中,我希望两个部分的数字都编号为1和2。
谢谢。
---
output:
bookdown::html_document2:
fig_caption: yes
number_sections: yes
---
# header 1
Reference example: @ref(fig:plotcars):
```{r plotcars, fig.cap = "A car plot"}
plot(cars)
```
# header 2
Reference example: @ref(fig:plotcars2):
```{r plotcars2, fig.cap = "A car plot"}
plot(cars)
```
我刚刚在bookdown的开发版本中添加了一个新参数global_numbering
。您可以通过测试开发版本
remotes::install_github('rstudio/bookdown')
示例:
---
output:
bookdown::html_document2:
fig_caption: true
number_sections: true
global_numbering: true
---
# header 1
Reference example: @ref(fig:plotcars):
```{r plotcars, fig.cap = "A car plot"}
plot(cars)
```
# header 2
Reference example: @ref(fig:plotcars2):
```{r plotcars2, fig.cap = "A car plot"}
plot(cars)
```