问题
The goal is to include a kableExtra
table in a PDF/HTML report generated with Rmarkdown/bookdown.
The short.caption
argument allows displaying a shortened version of the caption in the list of tables.
When generating a kableExtra
table from a list or a list of dataframes, the short.caption
argument does not function anymore.
The long caption is shown in the list of tables of the PDF report.
Also, using markdown expressions like **BOLD**
do not work in the titles either.
```{r CHUNK, echo=FALSE}
library(kableExtra)
my_list <- list(left = c(68, 48, 50, 113, 98, 94),
right = t2 <- c(26, 16, 22, 30, 16, 12))
kable(
my_list,
caption = "**Complete caption** for main document",
caption.short = "Short caption for LoT"
)
```
A related SO question
来源:https://stackoverflow.com/questions/65700917/kableextra-short-caption-argument-not-working-if-creating-table-from-list-or-us