我想在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
答案 0 :(得分:1)
您可以使用escape = FALSE
:
add_header_above(x2, c(" ", "$\\\\alpha$" = 5, "Group 2" = 6), escape = FALSE)