I made the mistake of upgrading from emacs 24.3 to 24.4 today, and I seem to have broken my auctex installation yet again. I always have trouble with this on new machines, but this is the first time I've had problems on my main machine. Even downgrading hasn't helped.
Following answers like this one:
PATH and exec-path set, but emacs does not find executable
I've had stuff this in my .init.el:
(getenv "PATH")
(setenv "PATH"
(concat "/usr/local/bin" ":" (getenv "PATH")))
(setenv "PATH"
(concat "/usr/texbin" ":" (getenv "PATH")))
(defun set-exec-path-from-shell-PATH ()
"Set up Emacs' `exec-path' and PATH environment variable to match that used by the user's shell.
This is particularly useful under Mac OSX, where GUI apps are not started from a shell."
(interactive)
(let ((path-from-shell (replace-regexp-in-string "[ \t\n]*$" "" (shell-command-to-string "$SHELL --login -i -c 'echo $PATH'"))))
(setenv "PATH" path-from-shell)
(setq exec-path (split-string path-from-shell path-separator))))
(set-exec-path-from-shell-PATH)
Later on I have:
(custom-set-variables
'(LaTeX-command "pdflatex -synctex=1"))
When I try to LaTeX from within emacs, I get the dreaded:
LaTeX: problems after [0] pages
error. pdflatex works fine from the command line (and has been working in emacs for a couple of years until I messed with it today!).
Added: getenv PATH shows:
/usr/local/bin:/usr/local/sbin:~/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/texbin:~/bin
which seems weird to me - I don't understand why /usr/texbin isn't at the beginning? Indeed I just checked and on my other machine (which I haven't touched) it is at the beginning.
Added: OK, this seems bizarre. I figured out how to get the log; it says:
Running
LaTeX' on
proper' with ``pdfpdflatex -synctex=1 --synctex=1 -interaction=nonstopmode "\input" proper.tex'' /bin/sh: pdfpdflatex: command not found LaTeX exited abnormally with code 127 at Tue Feb 3 17:06:15
Where could it be getting "pdfpdflatex" from?