#1210 tex: tex goes into an infinite loop

TeX (59)
Tino Weinkauf

If latex is called with "-interaction=nonstopmode", a
certain error causes it to wait for user input. Though it
should abort.

Tested with mikTeX 2.4.1705. This is to reproduce the

${<x,i,b>:i\leq |f(x)|\and}$ %gives error

If LaTeX is called from the command line without
"-interaction=nonstopmode", it certainly asks earlier for
recovering. Anyway, if one types "q" to enter the batch
mode, it won't quit. Typing Ctrl-C several times helps to
quit the job.

This bug was reported to the TeXnicCenter Bug List. And
I am very sorry, Christian, it was reported long ago:
2003-12-17. Sorry.

Anyway, as mentioned above, the current version has
this problem as well.


  • Logged In: YES

    Thanks for the report. I can reproduce the problem.

  • Logged In: YES

    Maybe I'm missing something but I see this as exactly what
    you'd expect. Just for the record: "q" means quiet
    (=\batchmode), not quit. If you want to quit you press "x".

    What you see here is TeX running along showing all the error
    messages on the terminal but not stopping for them (the
    definition of \nonstopmode) and it so happens that this
    particular error causes TeX to go into an inifinite loop. What
    you see at the end is not TeX waiting for user input but simply
    TeX trying to find the end of an infinite loop.

  • Tino Weinkauf
    Tino Weinkauf

    Logged In: YES

    Hi Morten!

    Did you try it?

    Yes, I know what "q" means. As I wrote above: "if one types
    "q" to enter the batch mode".

    The main problem, i.e. bug, is that latex simply doesn't
    quit. I consider an infinite loop as a bug.

    Might be, that it is not waiting for user input. But I
    executed it 10 minutes on a 1.7 GHz P4. It does not quit.
    The log file does not get bigger than 5 KB. It takes 99%
    system performance. Indeed, the latter speaks for the idea,
    that it doesn't wait for user input.

    Even if you don't enter the batch mode, the job will go into
    the infinite loop. Simply press enter several times at the
    tex prompt and after some error messages it won't return
    anymore to ask you something.

    So lets conclude: The job never finishes. Thats problematic
    enough to be considered as a bug.


  • Logged In: YES

    Sorry, but you won't find any help anywhere. The ability to
    create an infinite loop is something any programming language
    can do. Try definining \def\quark{\quark} and see what
    happens when \quark is executed. Same thing. Or try a
    number comparison test like \@whilenum1<2\do{} which also
    goes straight into an infinite loop.

    You happened to get into an infinite loop after TeX had given
    you a number of warnings telling you had misplaced something.
    It would be a bug if TeX went into an infinite loop if you had
    given it error free input that ought to wrok but that wasn't
    the case.

  • Tino Weinkauf
    Tino Weinkauf

    Logged In: YES

    Yes, you might be right. Btw, thats enough to reproduce it:

    ${\and}$ %gives error

    I am not sure, why this should end into an infinite loop.
    But I do not know the definition of \and at the moment. Anyway.

  • Logged In: YES

    \and is used when adding authors in \author{A \and B}. Try
    typing \show\and to see the definition.

  • Logged In: YES

    This is not a MiKTeX-specific problem:
    teTeX 3.0 (under Cygwin XP) goes into an infite loop, too.