Where do I get the pdflatex program for Mac?
I'm trying to convert Jupyter notebook to .pdf on Mac.
However, it tells me
nbconvert tailed: pdflatex not found on PATH
So, I went looking around and someone said, "Install mactex because this other way takes days to compile". So I did brew install Caskroom/cask/mactex
and it finished without telling me there was a problem, but unfortunately it didn't install pdflatex that I can gather. And 'mac install pdflatex' doesn't bring anything useful up on Google for me maybe my bubble sucks.
How do I install pdflatex on my mac?
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!
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