控制输出放置knitr + pandoc

时间:2014-06-04 21:06:54

标签: latex knitr r-markdown

我确定之前已经回答了这个问题,但是对于我无法找到的所有Google搜索功能。 我想在文档中显示多个表,其中包含标题和/或子标题。

Section 1
--------------------------------------------------------

```{r , results='asis', message=FALSE, echo=FALSE}
print(xtable(summary(lm(rnorm(10)~runif(10))), caption="Table 1"), 
      caption.placement =  "top",  table.placement = "H!", 
      include.rownames=FALSE, type="latex", comment=FALSE)
```
Section 2
--------------------------------------------------------
```{r , results='asis', message=FALSE, echo=FALSE}
print(xtable(summary(lm(rnorm(10)~runif(10))), caption="Table 2"), 
    caption.placement = "top",  table.placement = "H!", 
    include.rownames=FALSE, type="latex", comment=FALSE)

```

我发现编织后这个* Rnw的位置很好,但是一旦我pandoc()它

knit('C:/Users/Robin/Desktop/test.rmd', 'C:/Users/Robin/Desktop/test.md') 
pandoc('C:/Users/Robin/Desktop/test.md', format='latex')

生成PDF所有图像都被推到页面底部,在两个部分标题之后。有人能指出我有效的选择,因为H!在乳胶代码中似乎没有工作

1 个答案:

答案 0 :(得分:0)

Mb表格展示位置应为:table.placement = [h!]

相关问题