在Sweave中使用xtable在每个页面上的列名 [英] Column names on each page with xtable in Sweave
本文介绍了在Sweave中使用xtable在每个页面上的列名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在xtable的每一页上都有列名.
I want to have column names on each page of the 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
推荐答案
我认为这确实是LaTeX问题,我对此进行了简单的Google搜索,最后得到了tex.stackexchange.com
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中未曾试用过;如果按您希望的方式编译,会感到好奇):
Try this (untested in LaTeX; will be curious if this compiles the way you want):
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 "))
这篇关于在Sweave中使用xtable在每个页面上的列名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文