[英]Column names on each page with xtable in Sweave
I want to have column names on each page of the xtable. 我想在xtable的每个页面上都有列名。
\documentclass{article}
\usepackage{graphicx}
\usepackage{longtable}
\begin{document}
<<>>=
x <- matrix(rnorm(1000), ncol = 10)
x.big <- xtable(x,label='tabbig',caption='Example of longtable spanning several pages')
@
<<label = tabSEM.S, echo = FALSE, results = tex >>=
print(x.big,tabular.environment='longtable',floating=FALSE)
@
\end{document}
Any help will be highly appreciated. 任何帮助将受到高度赞赏。 Thanks 谢谢
I think this is really a LaTeX question, which I simply Googled and ended up with a simple answer from tex.stackexchange.com here . 我觉得这真是一个LaTeX的问题,我只是用Google搜索,并结束了从tex.stackexchange.com一个简单的答案在这里 。
Try this (untested in LaTeX; will be curious if this compiles the way you want): 试试这个(在LaTeX中未经测试;如果这样编译你想要的方式会很奇怪):
print(x.big,tabular.environment='longtable',
floating=FALSE,
hline.after = c(-1,nrow(x.big)),
add.to.row = list(pos = list(0),command = "\\hline \\endhead "))
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.