Welcome to the UK List of
TeX Frequently Asked Questions
on the Web

Searching

The index of Frequently Asked Questions about TeX is searchable.

Please enter your keyword here:   then press here: ,    or:
Google

Capacity exceeded [semantic nest …]

! TeX capacity exceeded, sorry [semantic nest size=100].
...
If you really absolutely need more capacity,
you can ask a wizard to enlarge me.
Even though TeX suggests (as always) that enlargement by a wizard may help, this message usually results from a broken macro or bad parameters to an otherwise working macro.

The “semantic nest” TeX talks about is the nesting of boxes within boxes. A stupid macro can provoke the error pretty easily:

\def\silly{\hbox{here's \silly being executed}}
\silly

The extended traceback (see general advice on errors) does help, though it does rather run on. In the case above, the traceback consists of

\silly ->\hbox {
                here's \silly being executed}
followed by 100 instances of
\silly ->\hbox {here's \silly 
                              being executed}
The repeated lines are broken at exactly the offending macro; of course the loop need not be as simple as this — if \silly calls \dopy which boxes \silly, the effect is just the same and alternate lines in the traceback are broken at alternate positions.

There are in fact two items being consumed when you nest boxes: the other is the grouping level. Whether you exhaust your semantic nest or your permitted grouping levels first is controlled entirely by the relative size of the two different sets of buffers in your (La)TeX executable.


Go to previous question, or next question

Go to FAQ home.

URL for this question: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=semanticnest

Comments, suggestions, or error reports? - see “how to improve the FAQ”.

This is FAQ version 3.28, released on 2014-06-10.