我正在使用 knitr 创建表格的输出。这里的问题是当我试图避免浮动到 xtable 时,标题不会出现。我用来避免浮动的选项floating="F"
在print(xtable)
我在 knitr 上使用了以下示例代码。
\documentclass[12pt,Arial]{article}
\usepackage[sc]{mathpazo}
\usepackage[T1]{fontenc}
\usepackage[left=0.7in, right=0.8in, bottom=0.6in, top=0.8in]{geometry}
\usepackage{float}
\begin{document}
\section{start}
<<comment=NA,results='asis',echo=FALSE>>=
library(xtable)
jd1 <- structure(c(23.16, 27.14, 31.03, 30.11, 33.03, 38.78, 23.45,
26.96, 30.93, 29.85, 32.53, 35.99, -2.965, -0.1998, 0.08065,
0.2588, 0.5829, 6.042, 0.0001466, 0.1369, 0.3252, 0.629, 0.9057,
6.042), .Dim = c(6L, 4L), .Dimnames = list(c("Min.", "1st Qu.",
"Median", "Mean", "3rd Qu.", "Max."), c("observed", "modeled",
"obsdmod", "aobsdmod")))
names(jd1)<- c("Observed","Modeled","Observed-Modeled","|Observed-Modeled|")
print(xtable(jd1,caption="Summary of table for observed and modeled temperatures at station T1"),type="latex",floating="F")
@
\end{document}