使用pandoc-crossref和R bookdown

时间:2017-10-31 06:34:35

标签: r bookdown

是否可以在bookdown中使用pandoc-crossref?

我尝试将yaml标题更改为:

output: 
    bookdown::tufte_book2:
        toc: yes
        highlight: tango
        pandoc_args: -F /usr/local/bin/pandoc-crossref

哪个应该将过滤器传递给pandoc,但是我收到错误:

pandoc: Error running filter  pandoc-crossref:
Could not find executable ' pandoc-crossref'.

当我输入正确的路径时,上述错误没有意义。使用什么样的env,这会阻止访问过滤器文件?

1 个答案:

答案 0 :(得分:2)

这是一个例子

---
output: bookdown::html_document2
---

# Section name {#id}

```{r pressure, echo=FALSE, fig.cap='test plot'}
plot(pressure)
```

Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot. To cross-reference the figure, use `\@ref(fig:pressure)` to produce Figure \@ref(fig:pressure). All this is found within the section \@ref(id).

哪个产生......

enter image description here

有关官方文档,请参阅https://bookdown.org/yihui/bookdown/figures.html