14

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?

3
  • 3
    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
    Commented Jul 27, 2012 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. Commented Jul 28, 2012 at 7:34
  • 1
    @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?
    – orome
    Commented Jul 28, 2012 at 14:04

3 Answers 3

10

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.

Update

With Mac OS X 11 (El Capitan) and TeX Live 2015 (or later), the first instruction should become

echo /Library/TeX/texbin > TeX
6
  • 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.
    – orome
    Commented Oct 17, 2015 at 13:13
  • It does not work on 10.11.2, after installing MacTex 2015 and tried the solution above with the two paths. In my case it 'worked' using the solution by Prashant Gaikwad. Commented Feb 22, 2016 at 22:37
  • @AntonioSesto Yes, with El Capitan one should use /Library/TeX/texbin instead of /usr/texbin, as said in the comment above.
    – egreg
    Commented Feb 22, 2016 at 22:59
  • @egreg I did, it did not work. I used /Library/TeX/texbin in Texshop preferences and now Texshop works. Pdflatex is in my path since it runs in Terminal.app (simply executing texshop), but this was not enough to have TexShop find it. Commented Feb 22, 2016 at 23:11
  • @AntonioSesto That's a different matter: TeXShop has its own method for setting the path; the question was more general.
    – egreg
    Commented Feb 22, 2016 at 23:16
7

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=.

2
  • 3
    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
    Commented Nov 12, 2012 at 16:10
  • Ok, updated with additional information. Thanks for the feedback! Commented Nov 12, 2012 at 18:42
4

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.

2
  • 1
    Still works like a charm as of 1/8/2016
    – Lee Mosher
    Commented Jan 8, 2016 at 20:02
  • 1
    This solution works. Commented Feb 22, 2016 at 22:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .