13

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!

Mico
  • 506,678
  • 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 01 '15 at 06: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 01 '15 at 06: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 01 '15 at 07: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 01 '15 at 08:11
  • I'm voting to close this question as off-topic because as clear from comments the issue is related to Mac OS X 'picking up' /etc/paths.d data which has been set correctly at the 'TeX end'. – Joseph Wright Oct 01 '15 at 08:38
  • @mico Did you ever solve this problem? I just updated to El Capitan and had the same problem which turned out to be an old path in /etc/profile. – Alan Munn Feb 01 '16 at 16:36
  • @AlanMunn -- I ended creating a file called ~/.profile, which contains only the following line: export PATH=/Library/TeX/texbin:/opt/local/bin:/opt/local/sbin:$PATH. I left /etc/profile unmodified; that file continues to point to (in two steps) to PATH="$PATH:/usr/texbin:/usr/local/bin. Indeed, /usr/texbin no longer exists under El Capitan. Note that with ~/.profile in place, /Library/TeX/texbin is searched first. – Mico Feb 01 '16 at 18:32
  • 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 01 '16 at 19:36

2 Answers2

4

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

while:

#pdflatex
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.

Thomas
  • 1,927
  • 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 01 '15 at 06: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 01 '15 at 06: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 01 '15 at 07: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 01 '15 at 07:08
  • Yes, I have MacTeX2015. (I mentioned it in the first paragraph of my posting.) – Mico Oct 01 '15 at 07:12
  • Just add it to your path in your shell init file. If you have not changed your shell, it is /Users/YOURUSERNAME/.bashrc. Google for "change PATH variable" if you run into trouble. – Thomas Oct 01 '15 at 07:15
  • @Mico From your comment on the question it looks like you've got the right data for Mac OS X to get the path right, but for some reason it's not 'taken'. That's a Mac problem rather than a TeX one. – Joseph Wright Oct 01 '15 at 07:23
  • Interestingly, there was no file named .bashrc -- or .cshrc, for that matter -- in my home directory. (I do know how to find "invisible" files.) May I ask you to edit your answer to focus on getting the PATH variable set up to include /Library/TeX/texbin -- I'll be glad to upvote and acccept your posting. – Mico Oct 01 '15 at 07:32
4

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`
fi

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

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.

Alan Munn
  • 218,180
  • 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