bookdown: punctuation between table numbering and table caption in docx output with knitr

166 views Asked by At

In the old bookdown (I forgot the version), there is a punctuation, such as :, between table number and the content of table caption. For example, it may be like Table 1:XXXX. However, it seems the punctuation losses in the newest bookdown. The caption now is Table 1 XXXX. But I like the punctuation more than without it. The following is an example.

---
output: bookdown::word_document2
---

```{r results = 'asis', echo = FALSE, eval = T}
data <- data.frame(ColA = c(1, 2, 3), colB = c('abc', 'def', 'ghi'))
kable(data, format = 'pandoc', booktabs = TRUE, longtable = TRUE, caption = 'test table')
```

Save the codes as test1.Rmd. After that attach the package bookdown and run

rmarkdown::render('test1.Rmd', output_format = 'word_document2', quiet = T)

the table caption is Table 1:test table with the old knitr, but now is Table 1 test table.

So my question goes as follows.

  1. Is there a way to add the punctuation between table number and content of table caption with the newest bookdown?
  2. If there is a way, could I change the punctuations, such from : to ., or from . to $. with the newest bookdown?
0

There are 0 answers