How do I install MacTex or another LaTeX distribution?
Even after installation, LaTeX commands like latex
, pdftex
or lualatex
are not found, and /usr/texbin/
doesn't exist.
Even worse, commands like sudo mkdir -p /usr/texbin
return "permission denied
"
Best Answer
The new Mac OS comes with a feature named "rootless" that disallows modification of important system files, even by the root user.
However, LaTeX installation requires access to the
/usr/texbin
folder, at least as an alias, and it is protected by Mac OS.There are two solutions:
1) Disable the rootless feature
To disable the rootless feature at boot, run this command:
Reboot, and then run:
if you already installed LaTeX from MacTex
2) Edit your
$PATH
If you don't want to disable the rootless feature, you can just modify your
$PATH
to point to the location of your LaTeX installation.For MacTex, files are located under
/Library/TeX/Distributions/.DefaultTeX/Contents/Programs/texbin
, so the following command in your.bash_profile
should work: