[英]bookdown figure number formattiing: both sequential numbering and section numbering
使用 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)
```
我只是增加了一个新的说法global_numbering
到bookdown的开发版本。 您可以通过以下方式测试开发版本
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)
```
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.