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

How can I set up a permanent compile loop that keeps trying even when there are errors? I'm using latexmk with a remote compile setup as discussed here and here. However, if I save a document with a bug (either a legitimate bug, or I save it before closing a tag), then latexmk halts. Any suggests how I can have it pause, try again, and keep trying again, for ever and ever?

share|improve this question
Use the -halt-on-error option in your latex command. So in bash I would write something like while true; do latex -halt-on-error filename.tex; sleep 5; done – Willie Wong Nov 19 '10 at 19:23
up vote 8 down vote accepted

There's \batchmode, which will disable terminal output and pretend you just pressed enter on every error message, but it won't save you from infinite loops. (There's also \nonstopmode, which I believe does the same with terminal output.)

There are usually corresponding command line switches, --interaction=batchmode or --batchmode

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.