8

I'm using GNU Emacs from emacsformacos.com After Migration to OSX 10.11 "El Capitan", Auctex can't run the *tex utilities anymore:

Running `LaTeX' on `poisson' with ``pdflatex  -file-line-error   -interaction=nonstopmode "\input" poisson.tex''
/bin/sh: pdflatex: command not found

There is no problem running for example pdflatex on the shell:

#pdflatex
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdflatex)
 restricted \write18 enabled.

but it seems that auctex calls /bin/sh pdflatex instead, and that does not work anymore:

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

maybe due to El Capitan's changes to Gatekeeper sandboxing. How can I configure auctex to run pdflatex again?

10

The problem was the PATH variable that Emacs uses (and passes on to shells it runs) is different from the users PATH variable. To customize Emacs' PATH one can use

(setenv "PATH" "/usr/local/bin:/Library/TeX/texbin/:$PATH" t)

With this change, AucTeX can call the command line programs again. See also this question.

Update (Nov 2015): In AucTeX 11.88.9 another check was installed to see if the command line programs are reachable. Even if the above method works, this check is more restrictive since it looks if the tex binaries are in the emacs path. To pass this check, /Library/TeX/texbin has to be added also to the exec-path variable. To do so, add this to your init file:

(setq exec-path (append exec-path '("/Library/TeX/texbin")))
  • It's true the check is more restrictive but it's a good idea to have exec-path well set anyway because it's used elsewhere (for example in TeX-doc) – giordano Nov 3 '15 at 10:33
1

El Capitan doesn't allow writing directly in /usr so the usual symbolic link to the TeX binaries, /usr/local, is removed when El Capitan is installed and can't be rebuilt. To compensate for that MacTeX-2015 and BasicTeX-2015 also install another symbolic link, /Library/TeX/texbin, in /Library/TeX which writable. The PATH for the CLI is set to include that link rather than /usr/texbin so it works out of the box. However many GUI applications need to be reconfigured.

I'd really like to get more details about where to put the line

(setenv "PATH" "/usr/local/bin:/Library/TeX/texbin/:$PATH" t)

to reconfigure Aquamamcs/AUCTeX since I'm not a user but others I'm in contact with are users.

  • Answering your question, that line must be put in your init file. – giordano Oct 25 '15 at 12:53
  • Hmmm... created the file init.el with the line above. I placed init.el in ~/.emacs.d/ which already exists in my HOME directory. But Aquamacs still doesn't seem to be able to compile my file. Is there some other incantation I have to use so that Aquamacs will automatically execute init.el? – Herb Schulz Oct 26 '15 at 13:07
  • If I remember correctly aquamacs uses other places for the init file, try googling it. – giordano Oct 26 '15 at 19:13

protected by Community Nov 1 '15 at 18:33

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

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