I'm trying to call AUCTeX from Emacs and I'm now getting the following error (quote marks changed slightly to get code block below to work):
Running 'TeX' on 'simple' with ''pdf/Users/myname/bin/pdflatex -file-line-error -interaction=nonstopmode simple.tex''
/bin/sh: pdf/Users/myname/bin/pdflatex: No such file or directory
TeX Output exited abnormally with code 127 at Thu Jun 2 16:53:50
I've checked paths which seemed like they would be the problem, but couldn't find anything. I also executed M-x shell
and entered
pdflatex —version
Which worked just fine, returning MiKTeX-pdfTeX 4.10 (MiKTeX 22.1) …as well as plenty of normal looking copyrights and trademarks and compilation information.
So where do I go from here?
I’m running Emacs Version 28.1 (9.0) on a Mac mini M1 with macOS Monterey 12.4.
EDIT: As requested in the comments below, I've added that part of my .emacs file showing my attempt to set up AUCTeX:
(setq TeX-auto-save t)
(setq TeX-parse-self t)
;; trying to get AUCTeX to work
(setenv "PATH" (concat (getenv "PATH") ":/Users/myname/bin"))
(setq exec-path (append exec-path '("/Users/myname/bin")))
(setq exec-path (append exec-path '("/Library/TeX/texbin")))
(add-to-list 'exec-path "~/bin")
(add-to-list 'exec-path "/Library/TeX/texbin")
(setenv "PATH" (concat "/Library/TeX/texbin:"
(getenv "PATH")))
(setq TeX-command "/Users/myname/bin/pdflatex")
(setq LaTeX-command "latex")
LaTeX-command
variable? It should belatex
rather than a path.TeX-command
is wrong: it is supposed to be the command to run plain TeX and should betex
and not a path. Remove this from yr config and try again.