![关于双宽帽的错误](https://linux22.com/image/407797/%E5%85%B3%E4%BA%8E%E5%8F%8C%E5%AE%BD%E5%B8%BD%E7%9A%84%E9%94%99%E8%AF%AF.png)
答案1
欢迎来到 TeX.SE。一个小型 MWE 演示了如何添加列标题。您的错误是在调用函数时kable
,您需要在其中添加format='latex',escape=FALSE
。
% Compile in RStudio to knit to pdf
\documentclass[a4paper,12pt]{article}
\usepackage{booktabs}
\begin{document}
<<Rcode,results='asis'>>=
library(kableExtra)
L1 <- data.frame("sxy"=2229,"sxx"=10954,"var"=6.8)
colnames(L1) <- c("$sxy$","$sxx$","$\\widehat{var}(\\widehat{b_0})$")
print(kable(L1,format='latex',escape=FALSE,booktabs=T))
@
\end{document}