Next: User-Defined Compositions, Previous: Other Compositions, Up: Compositions [Contents][Index]
The functions in this section are actual functions; they compose their arguments according to the current language and other display modes, then return a certain measurement of the composition as an integer.
The cwidth
function measures the width, in characters, of a
composition. For example, ‘cwidth(a + b)’ is 5, and
‘cwidth(a / b)’ is 5 in Normal mode, 1 in Big mode, and 11 in
TeX mode (for ‘{a \over b}’). The argument may involve
the composition functions described in this section.
The cheight
function measures the height of a composition.
This is the total number of lines in the argument’s printed form.
The functions cascent
and cdescent
measure the amount
of the height that is above (and including) the baseline, or below
the baseline, respectively. Thus ‘cascent(x) + cdescent(x)’
always equals ‘cheight(x)’. For a one-line formula like
‘a + b’, cascent
returns 1 and cdescent
returns 0.
For ‘a / b’ in Big mode, cascent
returns 2 and cdescent
returns 1. The only formula for which cascent
will return zero
is ‘cvspace(0)’ or equivalents.