I've tried to customize captions using expressions as described in this post.
While the post stated that Markdown syntax is supported, I could not make a strong type. Instead of strong type, in the book, I got caption enclosed with asterisks, like **Table 1.1.**. I reproduced this behavior by copying Yihui's minimal bookdown and adding _bookdown.yml to it.
index.Rmd
---
title: "reprex"
site: bookdown::bookdown_site
documentclass: book
output:
bookdown::gitbook: default
---
# Hello World
```{r}
knitr::kable(
head(iris),
caption = 'A table generated by the longtable package.'
)
```
Sorry for the delay on this. I believe this is a uncomplete answer on
It worked there because it was used with a word_document2() output format, and with it, the label prefix replacement from configuration happens at the Markdown step. It was a bit of a "hack" to use this for Word output.
It does not work with gitbook() or other format where the replacement happens not at the markdown step.
That is obviously internal stuff, and this could be considered an issue or at least a feature request to bring support to HTML format for passing markdown syntax in the configuration. Do you want to open one in Bookdown repo ? GitHub - rstudio/bookdown: Authoring Books and Technical Documents with R Markdown ?
Usually, for styling HTML one need to use CSS. To do that with the "Table 1.1" part of the caption with a HTML format, you need to use CSS. Something like this would work
caption span {
font-weight: 700;
}
Changing the CSS selector can help customize further. See also about the CSS rule