# How to change AUCTeX latex compile command? (using Emacs 23)

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?

-
Can you do it through M-x customize-group RET TeX-command? – Seamus Jul 18 '12 at 11:41
Changing the 'TeX Command' and 'LaTeX Command' variables suppresses the display of errors, but compilation still halts on the first error, which is different from the command-line behavior. – Ketil Tveiten Jul 18 '12 at 12:49
You may want to use latexmk to handle compiling. Then you can set the flags via .latexmkrc – N.N. Jul 18 '12 at 17:35

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

-
Thank you, this seems to work. – Ketil Tveiten Jul 19 '12 at 13:17
Is there a way to make this change in emacs init file ? – Anusha Apr 24 '14 at 17:20

Add this in you .emacs file:

(setf (nth 1 (assoc "LaTeX" TeX-command-list))
"%%l -interaction=nonstopmode %(mode)%' %t")
-