When I use the render{rmarkdown} to produce pdf file from .Rmd file on my Mac, an error message says
pandoc: pdflatex not found. pdflatex is needed for pdf output.
This might help a bit, in case you don't have any Latex stuff installed yet.
env: macOS Sierra
brew cask install basictex
(env) jluc@texbin$ pwd
/Library/TeX/texbin
(env) jluc@texbin$ ls | grep pdfla
lrwxr-xr-x 1 user wheel 6 13 Mar 10:36 pdflatex -> pdftex
(env) jluc@texbin$ ls /Library/TeX/texbin/pdflatex
lrwxr-xr-x 1 user wheel 6 13 Mar 10:36 /Library/TeX/texbin/pdflatex -> pdftex
/Library/TeX/texbin/pdflatex is what we need, you can't refer to the pdftex symlink and/or use realpath
because pandoc
specifically wants to see pdflatex
pandoc myfile.md --to=pdf -t latex -o myfile.pdf --latex-engine=/Library/TeX/texbin/pdflatex