TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When pdflatex can't compile a file, it drops me to a prompt. I've never used it and always try to get away from there as quickly as possible, usually generating a q.log file in the process.

Is there any way to avoid this behavior and let pdflatex drop back to command-line on error?

share|improve this question
Perhaps the answers to this question: Ignore compile errors will help. – Alan Munn Mar 13 '11 at 17:01
@Alan: Thanks. -halt-on-error (your link) and -interaction=nonstopmode (Martin Scharrer) seems to be what I'm looking for. – Tim N Mar 13 '11 at 17:05
Yes, -halt-on-error exits on error. Exactly what I'm after. Ignoring or not printing errors is not helpful. Especially when make then thinks everything's up to date. I've never used the interactive thing. Imo shouldn't be default. – jozxyqk Feb 15 '14 at 11:53
up vote 18 down vote accepted

Use the -interaction=nonstopmode command line argument or the \nonstopmode macro to disable stopping on errors.

share|improve this answer

-interaction <mode> Starts the so-called interaction mode, which can be specified as batchmode, nonstopmode, scrollmode or errorstopmode. The meaning of these options is the same as for the TeX commands of the same name. The reason why you can also say \batchmode as first line in your document. Then you do not need to modify the prompt in a GUI, if you use one.

share|improve this answer

To drop back to the command line on the first error like gcc (or other compilers do), use:

pdflatex -halt-on-error yourfile.tex
share|improve this answer
Took this information from the comments on the question. This is what simply worked for me. – Rudy Matela Feb 17 '14 at 17:50

Your Answer


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.