Rmarkdown and Bookdown are highly reliant on Pandoc. Sometimes, issues may happen when Rstudio is using an older version of Pandoc even if you have downloaded the newest version, as was discussed here .
Yihui’s Solution #
Yihui provided a solution
: to put the newest version of pandoc into
/usr/local/bin. How to do it?
First of all, you need to install the updated version of Pandoc you want. Remember the path where it is installed. If you installed in the past and have forgot where it was installed, there are two ways:
- Open a new
cmd+nif you are currently using
Terminal), first type
pandoc --version. If the version is waht you want, then input
which pandoc. The path of this version of Pandoc will be shown. How to open it?
It’s easy. If the path is
A/B/C/pandoc, then input
open -a Finder A/B/C and find the
pandoc-citeproc from there.
- Search “Pandoc” in Spotlight Search.
After knowing where the desired
Pandoc is located, then you just need to copy
pandoc-citeproc and paste them into
But how to open
Go back to your
Terminal, and type
open -a Finder /usr/local/bin.
I have to say that I didn’t verify whether the way suggested by Yihui will work.
My Solution #
My solution was inspired by the post above .
First, you need to check the version of
Pandoc that is used by Rstudio. Simply input
/Applications/RStudio.app/Contents/MacOS/pandoc/pandoc -v1 in your terminal, as suggested by Andrea
. If the output shows that Rstudio is using an older version of
Pandoc rather than the new version you just downloaded, then you can do the following to manually upgrade it.
open -a Finder /Applications/RStudio.app/Contents/MacOS/pandoc/ to open the folder where
Pandoc used by Rstudio is stored. Copy the new
open -a Finder A/B/C, the code in the first step of Yihui’s solution, as shown above.) and paste it to
It should work.
However, as Yihui also noted here . Pandoc 2.9. x or higher versions might not work for lower version of MacOS.
Of course, you can also use
rmarkdown::pandoc_version()in Rstudio to see the pandoc version used by Rstudio. ↩︎
Last modified on 2021-03-29