如何使用 knitr::kable 在 table 的底部添加注释?

How can I add notes to the bottom of a table using knitr::kable?

LaTeX 有能力 add notes to the bottom of a table 使用 tablenotes,所以看起来 kable 可以很容易地实现这一点——或者也许它已经做到了,但我可以'找不到任何提及此功能的信息。

例如:

您实际上可以使用 Hao Zhu 很棒的 kableExtra 包来做到这一点!如下:

library(knitr)
library(kableExtra)
dt <- mtcars[1:5, 1:4]

# LaTeX Table
 kable(dt, format = "latex", booktabs = T) %>%
   kable_styling() %>%
   add_footnote("Footnote 1", notation="alphabet")

Check out the GitHub repository for the full scope of everything kableExtra can do. It greatly extends the functionality of tables within both LaTeX and HTML with loads of extra features.