kableExtra :: LaTeX命令无法在add_header_above中正确呈现

时间:2019-02-06 13:17:40

标签: r latex knitr kableextra rnw

我想在LaTeX的{​​{1}}函数中使用add_header_above命令

kableExtra

但是,library(kableExtra) x1 <- knitr::kable(head(mtcars), "html") add_header_above(x1, c(" ", "Group 1" = 5, "Group 2" = 6)) add_header_above(x1, c(" ", "\\alpha" = 5, "Group 2" = 6)) x2 <- knitr::kable(head(mtcars), "latex") add_header_above(x2, c(" ", "Group 1" = 5, "Group 2" = 6)) add_header_above(x2, c(" ", "\\alpha" = 5, "Group 2" = 6)) 命令LaTeX无法正确呈现。请提供任何解决方案。

已编辑

\\alpha

1 个答案:

答案 0 :(得分:1)

您可以使用escape = FALSE

add_header_above(x2, c(" ", "$\\\\alpha$" = 5, "Group 2" = 6), escape = FALSE)

Yichaoz