繁体   English   中英

使用 pandoc-crossref 和 R 预订

[英]Using pandoc-crossref with R bookdown

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

我试图将 yaml header 更改为:

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'.

上述错误没有意义,因为我输入了正确的路径。 bookdown 使用什么样的环境,排除了对过滤器文件的访问?

这是一个例子

---
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).

产生...

在此处输入图片说明

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

当我尝试将数字放入 Word 文件中的方程式时,我遇到了类似的问题( SO question )。 我得到了同样的错误Could not find executable 'pandoc-crossref'

我的 RStudio 安装(在 Windows 上)没有pandoc-crossref 这是我所做的:

  1. 这里下载pandoc-crossref
  2. 找到 RStudio 保存文件pandoc.exe的路径:
rmarkdown::find_pandoc()
  1. pandoc-crossref.exe放在我进入 (2) 的文件夹中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM