What do empty math character class symbols ("\mathpunct{}") do, and when are they used?
Well you pretty much said what they do in your question, they make a math atom that has zero width, but which may or may not cause math spacing to be added depending on the class of adjacent atoms.
It crops up from time to time eg here
Too small space when using \DeclareMathOperator
And some people use \mathop{}
in their definitions of the differential "d" letter:
- What's the proper way to typeset a differential operator? (somewhere on the page)
- Should I \mathrm the d in my integrals? (somewhere on the page)
regarding \colon
, take a look at the comment in amsmath.pdf
just before code line 272:
\colon is for a colon in math that resembles a text colon: small space on the left, larger space on the right. The : character by itself is treated as a \mathrel i.e. large, equal spacing on both sides.
here the \mathpunct
dffectively "disables" the usual \mathrel
assigned to the character :
to allow different spacing to apply.
\mathpunct
is also cited, although it does not appear in the code, with respect to the
definition of multline
, to avoid an extra thinmuskip
when punctuation occurs at the end
and equation numbers are set on the right. (see the comment after line 2311.)