How to number table with chapter number

北城以北 提交于 2021-02-07 20:44:29

问题


I inclue and cross-referencing a table in a Rmd file, and I want to add chapter number with the table title and referencing number, like "TABLE 1.1 test", but not "TABLE 1 test". I render the file using bookdown::word_document2. Here is a minimal example:

---
title: test
output:
  bookdown::word_document2:
    fig_caption: yes
    toc: yes
---

```{r}
library(knitr)
```
# Heading 1
I'm cross-referencing a table table:\@ref(tab:test).

```{r test}
test <- data.frame(a = 1:6, b = 2:7)
kable(test, caption = "test")
```

output

Rmarkdown/Bookdown is really an amazing tool @Yihui, thanks!

来源:https://stackoverflow.com/questions/42250743/how-to-number-table-with-chapter-number

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!