TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

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

Using TeXLive 2011, I invoke lualatex on a TeX file from the command line. The PDF builds (mostly correctly, although the source TeX file has many many errors and warnings, none fatal). However, the exit code (%ERRORLEVEL%) is set to 1, which is normally used to indicate an error. Why does this happen?

share|improve this question
Welcome to TeX.sx! Please add a minimal working example (MWE) that illustrates your problem. – Werner Nov 9 '11 at 16:55
This is perfectly normal, when errors are encountered during compilation. – egreg Nov 9 '11 at 16:56
The output is started before all processing is complete. It is a common data processing pattern, and the presence of an output file does not imply success. – Andrey Vihrov Nov 9 '11 at 17:21

A standard behavior for programs is to exit with a non zero exit status when some error has been encountered during the execution.

The fact that the errors are not fatal and that some output is produced doesn't change this behavior that can be used in scripts or other programming environments.

Only warnings, such as "Overfull \hbox" or similar ones, make the exit status to be 0.

share|improve this answer

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.