[Tex/LaTex] AUCTeX can’t find PDFLaTeX

auctexemacs

I installed TeX Live 2011 from source in my Ubuntu. The AUCTeX module was also compiled and installed instead of pulling from Ubuntu's repository. However, when I opened a LaTeX file with Emacs, and compiled, it complained

Running 'LaTeX' on 'jun13' with “pdflatex -interaction=nonstopmode "\input" jun13.tex''
/bin/sh: pdflatex: not found

LaTeX exited abnormally with code 127 at Sat Oct 15 00:40:58

But PDFLaTeX was already in the PATH. I tried this file with TeXmaker, and it was successful. Could anyone please give me a hint what was going on? Thanks.

Best Answer

AUCTeX complains that pdflatex cannot be found. However, according to your comments you checked and found pdftex, not pdflatex, which still can be missing.

Today, pdflatex if often just a symbolic link to pdftex. For example, on my Ubuntu system with TeX Live 2011:

> ls -l `which pdflatex`
lrwxrwxrwx 1 root root 49 2011-10-07 22:13 /usr/local/bin/pdflatex
    -> /usr/local/texlive/2011/bin/x86_64-linux/pdflatex
> ls -l /usr/local/texlive/2011/bin/x86_64-linux/pdflatex
lrwxrwxrwx 1 root root 6 2009-08-15 19:49
    /usr/local/texlive/2011/bin/x86_64-linux/pdflatex -> pdftex

It finally points to pdftex.

So, you could

  • configure Emacs/AUCTeX to run pdftex instead of pdflatex, since LaTeX is just the format, not the engine or executable
  • or create a symbolic link, such as by

    ln -s /usr/local/texlive/2011/bin/x86_64-linux/pdftex pdflatex
    

    in your path, where it can be found.

  • or use the TeX Live Manager, start it by

    sudo tlmgr -gui
    

    and have a look in the menu Actions/ Managing symbolic links to the point update symbolic links or let it create symbolic links, this is also possible via command line option to tlmgr (see tlmgr --help).

Related Question