Getting Emacs to use pdflatex

Solution 1:

You can do this by setting latex-run-command; see the the emacs manual. Something like this in your .emacs should do it:

(setq latex-run-command "pdflatex")

Solution 2:

You can temporarily switch AucTeX to pdf mode with CTRLctp. To make this change permanent set

(TeX-PDF-mode t)

in your ~/.emacs file.

Solution 3:

Should it not be

(setq TeX-PDF-mode t)

in .emacs?

My version of emacs (GNU 24) complains when I just have (TeX-PDF-mode t).

(Or maybe this is because I am using AucTeX, which is awesome BTW.)

Solution 4:

After trying several approaches, the one that worked for me (also for AucTeX) was

M-x customize-group for TeX-command, and rewriting "Latex Command" to pdflatex.

(Changing the viewer to open the pdf wasn't even necessary, it just worked.)

(idea from here.)