Where do I get the pdflatex program for Mac?
Yes, same story with my MacOS Sierra:
(1) installed mactex with homebrew cask, but no pdflatex found after that:
$ brew cask install mactex
$ which pdflatex
[no location]
(2) relaunched the terminal app
(3) pdflatex found:
$ which pdflatex
/Library/TeX/texbin/pdflatex
Install BasicTeX
To get pdflatex
for Pandoc on macOS, install BasicTeX. Many people recommend MacTeX, which is a much bigger package than you need. BasicTex is produced by the same people who make MacTeX, but without, e.g., the GUI applications that make it so slow to download and install.
$ brew install basictex
- Restart Terminal.
- Convert LaTeX to PDF.
Example
Say you want to convert LaTex to PDF with Pandoc. You'd write:
$ pandoc sourcefile.tex -o output.pdf
, which fails with errorpdflatex not found. Please select a different --pdf-engine or install pdflatex
.- So you install BasicTex,
$ brew install basictex
. - Then restart your Terminal, and
- Run
$ pandoc sourcefile.tex -o output.pdf
again. Success!
It appears that brew does not, technically speaking, install mactex. It just downloads it.
I had to use the quick launch and type in mactex
which popped up an installer.
After it finished I pdflatex
existed, though I did have to start up a new shell - I'm assuming it did something to my path.