31

Although I never make any misteyk, occasionally I compile a TeX file in non-stop mode (that's how I roll) so wonderful that it just starts stuttering and spits out this

enter image description here

and provides some moral support as if it's going to make any difference to compile again.

  1. Is this an internal counter i.e. hardcoded executable level count?
  2. Is this a TeX or PDFTeX counter i.e. at which level is this counted?
  3. Can we access it and more importantly can we lower this threshold with a switch?

Teaser:

  • Can we access or reset during a compilation? I know how stupid it would be to modify this during a compilation but... yeah.
6
  • 21
    “Although I never make any misteyk” is a great statement!
    – Speravir
    Jan 26, 2013 at 2:46
  • No mistakes but errors (at least according to the output:-)
    – Guido
    Jan 26, 2013 at 3:47
  • 2
    "... any misteyk", That is good england... Jan 26, 2013 at 4:47
  • 6
    MWE please. ;)
    – doncherry
    Jan 26, 2013 at 6:38
  • 3
    Please read the logfile. There's more information there. :-) Jan 26, 2013 at 13:08

2 Answers 2

34

The 100 value is hard coded in TeX. When it finds 100 errors when processing the same paragraph, TeX assumes to be in an infinite loop.

Here, some misplaced token (an end of tabular line) causes the insertion of a closing brace (I guess), which however is again wrong, so a \cr is inserted back, causing an infinite loop. So TeX has this protection against it spinning its wheels without ever doing any progress.

You can't change this value, unless you modify the source of TeX and recompile the program.

The hard coded value is in module 82 of tex.web.

2
  • wouldn't \maxdeadcycles set it?
    – yannisl
    Jan 26, 2013 at 12:49
  • 5
    @YiannisLazarides no that's also 100 by default in latex but counts how many times the output routine has been called without making a page, not errors Jan 26, 2013 at 13:10
10

I would just add my two cents of experience. In (*)TeX, there are two types of errorneous code:

  1. Typos that lead to one small piece of code being wrong, with no affect to the future, e.g. $\aloha$ instead of $\alpha$, or forgotten mathmode like As we can see, f(x)=\frac{e^x}{x}, forgotten \item etc. These mistakes usually "sort out" in place, or at the end of the paragraph, producing one or two error messages.

  2. Typos/errors that propagate throughout long piece of code. For example misspelled {talubar}, which throws first "Undefined environment", and then "Misplaced \cr" for every & in the table. These, in my experience, produce so many errors that it doesn't make sense to continue in compilation anyways. The only reasonable thing is to find the first of them and correct it.

1
  • Indeed that's usually the case. But I was more curious about stopping a compilation earlier or even seeing whether this error count is available inside a TeX counter etc. 54 errors from different sources are also too many for me. So build up to 100 is a little too high for nonstop mode imho.
    – percusse
    Jan 26, 2013 at 11:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .