Where do I get the pdflatex program for Mac?
Solution 1
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.
Solution 2
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!
Solution 3
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
Related videos on Youtube
Wayne Werner
I'm a husband to my beautiful wife, father to our children, Computer Science graduate from University of Central Arkansas. I love my wife, our children, computers, playing guitar (especially singing/playing for my wife and/or kids), bicycling (including taking my kids for rides in my bike trailer), woodworking, airbrushing, digital and traditional artistry, playing games with my family (traditional and digital), my poor Chevette that I had to sell, throwing knives, firearms, knot tying, rope making, whip making, and really just learning new stuff in general. If I don't know about it I probably want to learn about it, if only so I can make informed decisions about it. My three favorite programming languages are Python, Lisp, and Assembly (though I'm not sure about the order of those last two languages...). I think the CANSPAM act is one of the dumbest pieces of legislation in the history of the universe I love Python and HTML+Javascript. I'm #SOreadytohelp (I really want a t-shirt, what can I say?)
Updated on September 18, 2022Comments
-
Wayne Werner over 1 year
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?
-
Admin about 8 yearsHave you tried tug.org/mactex/mactex-download.html ?
-
Admin over 3 yearsFWIW
brew cask install <something
has been changed to `brew install <something>. See here
-
-
Dennis about 7 yearsI just tried and installing the cask did install MacTeX. But I had to start a new shell instance for
pdflatex
to be recognisable. This is because installing MacTeX modifies your PATH by including/Library/TeX/texbin
which is where thepdflatex
binary lives. -
ijt over 5 yearsI ran
brew cask install mactex
butpdflatex
didn't show up in/Library/TeX/texbin
. Instead it was in/Library/Tex/Distributions/.DefaultTeX/Contents/Programs/x86_64/pdflatex
. -
mrgloom over 4 yearsFor me just cmd+t in iTerm helped.
-
Taylor D. Edmiston over 4 yearsInstalling
basictex
this way did not seem to work for me for generating a PDF:$ pandoc a.tex -o b.pdf [WARNING] Unusual conversion: to convert a .tex file to PDF, you get better results by using pdflatex (or lualatex or xelatex) directly, try `pdflatex a.tex` instead of `pandoc a.tex -o b.pdf`. pdflatex not found. Please select a different --pdf-engine or install pdflatex
-
theonlygusti about 4 yearsI get the same error as Taylor Edmiston. Additionally,
pdflatex
itself errors a lot ofcould not find *.sty
and then doesn't generate a PDF at the end... -
hamx0r almost 3 yearsYou may need to install some latex packages:
sudo tlmgr update --self
thensudo tlmgr install framed
-
Gerry almost 3 yearsAgree with the others. The answer lead me down a painful path. I have no idea why it's voted so high.
-
Merchako almost 3 yearsWhat's the next step if this isn't relevant anymore? Are there some straightforward changes that I can make, or do I need to take the answer down?
-
codehead over 2 yearsInstalling
mactex-no-gui
and opening a new shell should do the trick these days. -
Admin almost 2 yearsNow, in 2022, I had to use
brew install --cask mactex
to install it.