[Tex/LaTex] How to change AUCTeX latex compile command? (using Emacs 23)

auctexemacspdftex

I'd like to configure AUCTeX to compile without stopping on errors. I can do it from a terminal with

pdflatex -interaction=nonstopmode filename.tex

but AUCTeX apparently does

pdflatex filename.tex

when asked to compile with C-c C-c. How can I force the "-interaction=nonstopmode" option?

Best Answer

I use Emacs 23.4 on Mac OS 10.7. That's what I've done:

  • Create a LaTeX file so you have all the AUCTeX menus available
  • Go to LaTeX -> Customize AUCTeX -> Browse options
  • Click on TeX Command
  • Expand TeX Command List and press on one INS button
  • Fill the appeared fields as here:
    1. Name: LaTeXnonint
    2. Command: %`%l -interaction=nonstopmode %(mode)%' %t
    3. How: TeX-run-command

In this way, if I try to compile (hitting C-c C-c LaTeXnonint) a file like:

\documentclass[a4paper]{article}

\begin{document}
\latex
\end{document}

I get no interaction on the present error (\latex instead of \LaTeX)

P.S. the first three points of the list can be made using the shortcut showed by @Seamus