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.
As of 2020 (MacOS Catalina) JL Peyret's answer is the most applicable. It should be slightly updated, since the --latex-engine
option in pandoc has been deprecated in favor of the new --pdf-engine
option:
$ brew cask install basictex
$ pandoc myfile.md --to=pdf -t latex -o myfile.pdf --pdf-engine=/Library/TeX/texbin/pdflatex