[Tex/LaTex] Install LaTeX on Mac OS X El Capitan (10.11)

filesystem-accessinstallingmactex

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:

sudo nvram boot-args="rootless=0 kext-dev-mode=1"

Reboot, and then run:

sudo ln -s /Library/TeX/Distributions/.DefaultTeX/Contents/Programs/texbin /usr/texbin

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:

export PATH=$PATH:/Library/TeX/Distributions/.DefaultTeX/Contents/Programs/texbin
Related Question