Last night, I migrated my MacBook's operating system from 10.10 "Yosemite" to 10.11 "El Capitan". Everything seemed to go smoothly. Happily, regarding my TeX-related work, I am able to use the GUI front ends "TeXworks" and "TeXshop" just fine since completing the OS upgrade. I use MacTeX2015, with all the latest updates installed.

Oddly, though, since completing the upgrade I can no longer run any MacTeX command-line utilities such as texdoc and kpsewhich. (Actually, as I just discovered, I can no longer run pdflatex either from a command line. However, I never do run pdflatex from a command line prompt, so that's not an urgent problem for me -- at least not for now.)

The suggestions given in the posting Mavericks upgrade screwed up my pdflatex (command not found) do not seem to be applicable to this case, as they all seem to revolve around setting up /usr/texbin correctly -- /usr/texbin is no longer allowed under MacOSX 10.11. The document MacTEX-2015 and El Capitan by Herb Schulz deals in depth with adjusting settings in the GUI front ends, but it appears not to touch on what to do about /usr/texbin, which appears to be the now-missing link to TeX's command line utilities.

Pointers and solutions most welcome!

  • No El Capitan here yet, but have you tried simply adding the new 'flexible' location /Library/TeX/texbin to the list available in /etc/paths.d? That's where the 'magic' happens. (I've got for using the normal *nix approach of just adding the real binary location to my path for other reasons.)
    – Joseph Wright
    Oct 1 '15 at 6:01
  • @JosephWright - There are currently three files in the directory /etc/paths.d (all three world-readable but only root-writeable): 40-XQuartz, TeX, and git. The content of the file named TeX is a single line, /Libary/TeX/bin. Do I need to modify the file called TeX?
    – Mico
    Oct 1 '15 at 6:52
  • That's the right setting for El Capitan: it should but /Library/TeX/bin into your path, and its there that the real links should be. What does echo $PATH give, and if it's in the path what about ls -l /Library/TeX/bin and command -v pdftex?
    – Joseph Wright
    Oct 1 '15 at 7:21
  • 1
    @JosephWright - Happily, the directory /Library/TeX/bin contains all the correct symbolic links. The source of the problem, then, appears to be that (a) the file .profile (or, equivalently, I suppose, .bashrc) didn't include the string /Library/TeX/texbin in the definition of $PATH and (b) for some reason, the information in /etc/paths.d wasn't being "taken" by MacOSX 10.11. For now, I think I've solved the problem by adding /Library/TeX/texbin to the definition of $PATH.
    – Mico
    Oct 1 '15 at 8:11
  • 1
    @mico Ok. My machines typically have multiple users, so I prefer not to have per user profiles for stuff that should be available to all users. I removed the old code that was in /etc/profile and replaced it with eval $(/usr/libexec/path_helper -s) within the whoami != "root" conditional.
    – Alan Munn
    Feb 1 '16 at 19:36

This problem can be caused by some leftover junk from previous versions of TeXLive which at one point added the path /usr/texbin to the /etc/profile file (the global /bin/sh profile).

The default /etc/profile on current version of the MacOS should be the following:

# System-wide .profile for sh(1)

if [ -x /usr/libexec/path_helper ]; then
        eval `/usr/libexec/path_helper -s`

if [ "${BASH-no}" != "no" ]; then
        [ -r /etc/bashrc ] && . /etc/bashrc

If your /etc/profile contains code to add /usr/texbin to the PATH, you should remove it. You should not replace the code with /Library/TeX/texbin, but instead remove the code entirely and make sure the /etc/profile file correctly executes the path_helper, which is the proper way for paths to be modified in OS X.

You can also solve this problem locally, by modifying your ~/bash_profile, to add /Library/TeX/texbin to your path, but then you will need to do this for each user on your system if you have multiple users.

  • Many thanks for this answer! I've updated the file /etc/profile on my system (and deleted ~/.profile, since it's no longer needed), and things are working fine.
    – Mico
    Feb 21 '16 at 15:19

You can not use /usr/texbin anymore. This is a final change. Every program relying on that link needs to be fixed. I think this is what Herb Schulz' file also tries to say.

Another change is that /usr/sh won't run non-signed programs anymore. So the /usr/sh pdflatex that emacs is trying won't work:

#/bin/sh pdflatex
/Library/TeX/texbin/pdflatex: /Library/TeX/texbin/pdflatex: cannot execute binary file


This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) ...

This may be Apple's fix for recent reports of Gatekeeper breakouts.

  • I apologize for not having expressed myself more clearly: I am aware that /usr/texbin is verboten under MacOSX 10.11. My question is, what to do?
    – Mico
    Oct 1 '15 at 6:54
  • When you do a fresh install of MacTex 2015, it will create all the symlinks in /Library/TeX/texbin/, so you can add that to your PATH variable. MacTeX also tries to do that upon installation, but maybe you are using a different shell? Is that what you are asking?
    – Thomas
    Oct 1 '15 at 6:57
  • When I type echo $PATH, I get /opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/texbin:/usr/local/bin. Looks like something got badly clobbered! I use the bash shell, just in case that matters.
    – Mico
    Oct 1 '15 at 7:01
  • The duplicates should not hurt, although it would be good to debug why they are there. I have /Library/TeX/texbin in my path, and I'm not adding it manually in any user local config files. It's globally added to PATH my MacTeX. Do you have MacTeX 2015?
    – Thomas
    Oct 1 '15 at 7:08
  • Yes, I have MacTeX2015. (I mentioned it in the first paragraph of my posting.)
    – Mico
    Oct 1 '15 at 7:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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