How to make R Markdown use an updated version of pandoc on my Mac

From your output of echo $PATH, it appears that you added /anaconda2/bin to PATH in something like .bash_profile, which usually won't be recognized by RStudio or R. A couple of possible solutions:

  1. Symlink (i.e., ln -s) pandoc and pandoc-citeproc to a common path in PATH, such as /usr/local/bin. This path should be recognized by all packages in your system. Personally I haven't succeeded in tweaking PATH in .Renviron (and I don't really know how R handles this file; I feel it is different with .bash_profile).

  2. Add /anaconda2/bin to the PATH variable in a way that R can recognize, e.g. do Sys.setenv(PATH = ...) in your .Rprofile.

  3. The RStudio Preview version has actually bundled Pandoc 2.x: https://www.rstudio.com/products/rstudio/download/preview/

1 Like