TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have an up-to-date installation of MacTeX (2012) on my machine, but a recent upgrade of my system software seems to have removed TeX from my path. TeX Live Utility recognizes my installation and confirms that it is current, as do the settings in System Preferences, but the path is missing.

Is there a TeX utility that I can run to restore it, or do I need to re-donwnload and re-run the MacTeX installer?

share|improve this question
Try doing "ls /etc/paths.d" from a terminal window. If TeX doesn't appear, issue "echo /usr/texbin > TeX" and then "sudo mv TeX /etc/paths.d"; the system will ask your password, give it and press return. Logoff an login. Note that I used the quotes only to emphasize the commands to issue. – egreg Jul 27 '12 at 23:25
I agree with egreg. After an update of Lion with Mountain Lion, I lost the file TeX. If you used Time Machine, you can find the file TeX. Personally, I used TextMate to create the file TeX with the content /usr/texbin. – Alain Matthes Jul 28 '12 at 7:34
@egreg: That seems to do the trick (in the process I discovered that Applescript does not use path_helper to find what's in what's in /etc/paths.d, but that's another issue). Is this the only MacTeX thing that Mountain Lion messed up, or have others found other issues since the upgrade? – raxacoricofallapatorius Jul 28 '12 at 14:04
up vote 8 down vote accepted

Depending on how the installation is performed, it may happen that the new system doesn't keep the necessary file in /etc/paths.d

The solution is simple: restore the file in the correct position. From a Terminal window, issue the following two commands

echo /usr/texbin > TeX
sudo mv TeX /etc/paths.d

(you will be asked to type your password; this must be done by a user with administrative privileges).

A logoff-login cycle should solve the issue.

share|improve this answer
This solution continues to work in 10.11, though with SIP enabled, the path needs to be changed to /Library/TeX/texbin rather than /usr/texbin. – raxacoricofallapatorius Oct 17 '15 at 13:13

Just thought i'd add my two cents. egreg's solution is great but usage of paths.d and the path_helper is kind of discouraged in Mac OS X, at least when using ZSH and so that answer could not be working if paths.d is disabled.

I added /usr/texbin to my path and everything was happy.

To do that, I opened my .zshrc and appended :/usr/texbin to the line that defines my path. The line starts with: export PATH=.

share|improve this answer
The problem now is how do you add /usr/texbin/ to your path? :) Can you expand your answer? I believe it's interesting for those who set zsh as their default shell. Welcome to TeX.SX! – egreg Nov 12 '12 at 16:10
Ok, updated with additional information. Thanks for the feedback! – Tyler Brock Nov 12 '12 at 18:42

Simple: Open TeXShop, select preferences under menu options, under that select Engine option, In that option change the tab Path settings to your texbin path, in my case it was /usr/texbin which I had to change to /Library/Tex/texbin.

That's it. No need to add any other paths any where else. It's already so user-friendly.

share|improve this answer
Still works like a charm as of 1/8/2016 – Lee Mosher Jan 8 at 20:02

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.