kableExtra: short.caption argument not working if creating table from list or using list of dataframes

六月ゝ 毕业季﹏ 提交于 2021-01-25 01:44:42

问题


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

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