【发布时间】:2014-01-24 10:10:44
【问题描述】:
我正在使用 knitr 和 pandoc 将报告写入 word(我们需要能够使用轨道更改等为 cmets 进行循环)。
到目前为止它运行得很好,但我发现情节都在底部带有字幕,我不想要字幕。虽然我可以在 word doc 中删除它们,但如果我可以阻止它们在代码中显示会更好。
所以对于markdown中的以下代码:
Test test test
```{r}
summary(cars)
```
You can also embed plots, for example:
```{r fig.width=7, fig.height=6}
plot(cars)
```
然后我在 R 中运行以下代码:
library("knitr")
# Stackoverflow table test 1.html
knit2html("captiontest.rmd")
FILE <- "captiontest"
system(paste0("pandoc -o ", FILE, ".docx ", FILE, ".md"))
并且该图在 word 文档中的标题为“plot of chunk unnamed-chunk-2”
我知道我可以更改此标题,例如{r fig.width=7, fig.height=6, fig.cap='hello'},但我认为fig.cap=NULL 会将其隐藏。相反,它似乎使整个情节消失了。
情节是否需要有标题 - 我是否只需要浏览每个单词文档并手动删除它们?或者有没有办法隐藏它们?
【问题讨论】: