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

The following document infinite-loops:





LaTeX displays

> the character ,.
,->\show ,
          ,\allowbreak \show 0
l.113 \allowbreaks{$,$}



If I type I\show into it's prompt, it gives me

> the character ,.
,->\show ,,
           \allowbreak \show 0
l.113 \allowbreaks{$,$}

That is, the token that it's expanding it a character, not a macro. How is this possible?

If I comment out the breqn line, it works fine. I'm using pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009/Debian).

share|improve this question
It runs without error with my texlive 2010 installation – David Carlisle Feb 7 '12 at 23:48
up vote 6 down vote accepted

When you say \detokenize{,}, the comma becomes a character of category code 12, so \show, will show the meaning of this character.

The \edef will define the active comma to expand to


where the two commas have category code 12.

But when breqn is loaded, the comma has mathcode "8000 and you are in math mode! So TeX follows its rules: after having shown the meaning of the comma it finds another comma and, having it category code 12 and mathcode "8000, TeX replaces it with the meaning it currently has as an active character. That is, to show the comma and to use a comma, which has category code 12 and mathcode "8000

Oops, infinite loop. :-)

share|improve this answer
you should mention that to "disable" the comma, its mathcode should be set to the value before breqn is loaded. Either with \mathcode`\,=..., or with \mathchar`\,. – Bruno Le Floch Feb 8 '12 at 0:44

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.