Reputation: 2063
Is it possible to use pandoc-crossref in bookdown?
I tried to change the yaml header to:
output:
bookdown::tufte_book2:
toc: yes
highlight: tango
pandoc_args: -F /usr/local/bin/pandoc-crossref
Which should pass the filter to pandoc, but I get the error:
pandoc: Error running filter pandoc-crossref:
Could not find executable ' pandoc-crossref'.
The above error does not make sense, as I entered the correct path. What kind of env is bookdown using, which is precluding the access to the filter file?
Upvotes: 2
Views: 1055
Reputation: 5702
I had a similar issue while I was trying to put numbers to equations in Word files (SO question). I got the same error Could not find executable 'pandoc-crossref'
.
My RStudio installation (on Windows) did not come with pandoc-crossref
. Here is what I did:
pandoc-crossref
from here.pandoc.exe
:rmarkdown::find_pandoc()
pandoc-crossref.exe
in the folder I got in (2).Upvotes: 1
Reputation: 6264
Here is an example
---
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).
Which produces...
See https://bookdown.org/yihui/bookdown/figures.html for the official documentation.
Upvotes: 3