I am trying to compile a .tex file using AUCTeX on Emacs 27.2. When I run the LaTeX command (via the menu bar) I get the following message:
TeX-command: ERROR: AUCTeX cannot find a working TeX distribution.
Make sure you have one and that TeX binaries are in PATH environment variable.
If you are using OS X El Capitan or later
remember to add /Library/TeX/texbin/ to your PATH
I have a file called TeX in /etc/paths.d which contains the line /Library/TeX/texbin
. And if I open the .tex file with TeXShop it compiles fine. The start of the message file just to prove it:
This is pdfTeX, Version 3.141592653-2.6-1.40.22 (TeX Live 2021) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./Chapter1.tex
Any help greatly appreciated.