I am trying to predict in any given situation what TeX does if a closing brace reaches its stomach (apart from reverting local assignments). For instance, \vbox{\tracingall H}
shows that if it is in horizontal mode when closing a vbox, then TeX first cuts the current paragraph into lines before leaving the vbox group. One way to determine what TeX does is to list all possible combinations of group type and mode which can occur, and the corresponding action to be taken.
Is that a reasonable approach? If so, what is that list? Any better method? For reference, I put below the list of modes and group types.
TeX knows of six modes (see Chapter 13 of the TeXbook):
- Vertical mode.
- Internal vertical mode.
- Horizontal mode.
- Restricted horizontal mode.
- Display math mode.
- Math mode.
According the the eTeX manual, TeX knows 17 group types, and we can access that information through \currentgrouptype
:
- bottom level (no group) (0)
- simple group (1)
- hbox group (2)
- adjusted hbox group (3)
- vbox group (4)
- vtop group (5)
- align group (6)
- no align group (7)
- output group (8)
- math group (9)
- disc group (10)
- insert group (11)
- vcenter group (12)
- math choice group (13)
- semi simple group (14)
- math shift group (15)
- math left group (16)