想象一下我编织了这个 Rnw 文件:
\documentclass{article}
\begin{document}
Table1
<<example,results='asis', echo=FALSE>>=
require(xtable)
nn <- 15
mydata <- data.frame(A=1:nn,C=nn:1, C=runif(nn), D=rnorm(nn))
xtable(mydata, caption="Table1")
@
Table2
<<example2,results='asis', echo=FALSE>>=
xtable(mydata, caption="Table2")
@
Table3
<<example3,results='asis', echo=FALSE>>=
xtable(mydata, caption="Table3")
@
\begin{obeylines}
Just some text
\end{obeylines}
\end{document}
这是一个简单的示例,仅打印一些文本和三个表格。
Strangely it doesn't respect the order of what I've written on my code.
I get this (sideview of the two pdf pages)
但“Table3”文本应出现在 table3 本身之前和 table2 之后,并且文本“只是一些文本”应出现在文档的最末尾。
如果我在那里写几行,就会断行。
我知道,如果表格不适合某个位置,则必须将其移至下一页,但应该使用以下文本和表格来完成此操作。
我还观察到,在其他示例中,某些表在不太适合时会被随机重新分配。
我怎样才能防止 knitr 这样做?
不知道是针织的问题还是乳胶的问题。
我正在使用 Texlive 2015、Rstudio、R 3.2.3 和 Windows 10 以及涉及的所有软件包的最新版本。