rmarkdown: pandoc: pdflatex not found

后端 未结 7 1311
没有蜡笔的小新
没有蜡笔的小新 2021-01-31 06:58

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.

7条回答
  •  面向向阳花
    2021-01-31 07:39

    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
    

提交回复
热议问题