I have a Macbook. I just installed Emacs and AUCTeX. I then installed MacTeX. When I open a .tex file, and try to compile it into pdf, it gives an error message of "AUCTeX cannot find a working TeX distribution." It also says to add a certain directory to my PATH. How do I correct this? Thanks.
1 Answer
MacTex is installed alike to a typical Mac application, not like regular TeXLive distributions which are installed in the classic filesystem hierarchy (which means, {la,pdf,xe}tex reside in /usr/bin and can be found by any program). Hence, the path /<where-you-installed-MacTeX>/bin
needs to be added to the system-wide variable $PATH. Some other variables which are relevant to tex itself need also be set. Otherwise, MacTex just resides by itself in the directory where you installed it and can neither be found by Emacs nor be used by it without errors. In addition, you need to tell auctex which tex binary to use; this is easiest done via M-x customize-group auctex
and setting the tex-command.
For somebody completely new to this, setting up the combo of MacTex and Emacs/AucTeX is not exactly easy, but manageable. I strongly advise to look into the MacTex FAQ on their site.
$PATH
in Emacs is pointing towards your TexLive installation. There is an optional Emacs library that you can install which will look up the system shell path and add it to Emacs ... just do a little Googling and you will find at least 3 prior threads that deal with that issue and they talk about that optional library that you can install .... I set the$PATH
in a different way and do not use AUCTeX ... but there are lots of ways to do it.exec-path-from-shell
.