Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I configure Emacs to run pdflatex rather than latex on a LaTeX file when I type C-c C-f (tex-file)?

share|improve this question
    
Probably next time you'd like to post such a question at TeX.SE :) –  Dror Jul 26 '12 at 8:59

4 Answers 4

up vote 9 down vote accepted

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")

share|improve this answer
    
Thanks! That did the trick. –  John D. Cook May 19 '10 at 13:45

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

(TeX-PDF-mode t)

in your ~/.emacs file.

share|improve this answer

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.)

share|improve this answer

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.)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.