Fork me on GitHub


This module deals with creating delimiters of various sizes. The TeXbook discusses these routines on page 441-442, in the "Another subroutine sets box x to a specified variable delimiter" paragraph.

There are three main routines here. makeSmallDelim makes a delimiter in the normal font, but in either text, script, or scriptscript style. makeLargeDelim makes a delimiter in textstyle, but in one of the Size1, Size2, Size3, or Size4 fonts. makeStackedDelim makes a delimiter out of smaller pieces that are stacked on top of one another.

The functions take a parameter center, which determines if the delimiter should be centered around the axis.

Then, there are three exposed functions. sizedDelim makes a delimiter in one of the given sizes. This is used for things like \bigl. customSizedDelim makes a delimiter with a given total height+depth. It is called in places like \sqrt. leftRightDelim makes an appropriate delimiter which surrounds an expression of a given height an depth. It is used in \left and \right.



There are three different sequences of delimiter sizes that the delimiters follow depending on the kind of delimiter. This is used when creating custom sized delimiters to decide whether to create a small, large, or stacked delimiter.

In real TeX, these sequences aren't explicitly defined, but are instead defined inside the font metrics. Since there are only three sequences that are possible for the delimiters that TeX defines, it is easier to just encode them explicitly here.



Get the font used in a delimiter based on what kind of delimiter it is.