# [OS X TeX] OT: spacing after operator in math

Bruno Voisin bvoisin at mac.com
Sat Dec 23 01:59:48 EST 2006

Le 22 déc. 06 à 19:08, Bruno Voisin a écrit :

> I have been trying to determine how is specified the spacing between
> a log-like operator (\log, \sin, etc.) and its argument, with no
> luck. I imagine it must be some value in math units (mu), but even
> after browsing through chs 17 ff. of the TeXbook I feel none the
> wiser.
>
> [...]
>
> But what the heck is this space? Is this some hard-coded value inside
> the source code of TeX itself, or some accessible and clearly defined
> parameter within plain TeX or LaTeX?

Le 22 déc. 06 à 19:26, Frank STENGEL a écrit :

> It seems to be hard-coded in TeX. There is a table explaining what
> kind of space is added when in chapter 18 of the TeXBook (p170 in
> my copy). The TeX primitives \mathop, \mathrel, \mathopen,
> \mathclose etc. will adjust spacing around their arguments.

Le 22 déc. 06 à 20:04, Frank STENGEL a écrit :

> Le 22 déc. 06 à 19:26, Frank STENGEL quite hastily wrote :
>
>> It seems to be hard-coded in TeX.
>
> Not completely.
>
>> There is a table explaining what kind of space is added when in
>> chapter 18 of the TeXBook (p170 in my copy). The TeX primitives
>> \mathop, \mathrel, \mathopen, \mathclose etc. will adjust spacing
>> around their arguments.
>
> This is what is hard-coded. However in appendix G. rule 20 (p446 in
> my copy), DEK says that the spaces used are those given by the
> three registers \thinmuskip, \medmuskip and thickmuskip
> (corresponding to the 1, 2 and 3 entries in the aforementionned table.

Le 22 déc. 06 à 19:49, John Rawnsley a écrit :

> According to p525 of the Companion 2nd ed spacing between various
> math types is hard wired. The values given in the table are in terms
> of {thin,med,thick}muskips.

Frank, John,

Many thanks. This is exactly the info I was looking for. I had gone
too rapidly through chapter 18 of the TeXbook, and I still don't have
(shame on me!) the 2nd edition of the LaTeX Companion.

So all is in terms of \thinmuskip, \medmuskip and \thickmuskip. I
thought the corresponding commands \, \> and \; inserted just
arbitrarily chosen spaces, and not the elementary spaces used between
all elements of math formulae. Thanks for the correction!

If I interpret the table in the TeXbook right, the space between an
operator (of type \mathop) and its argument (of type \mathord) is
\thinmuskip. Thus it seems that while \newcommand{\sign}{\mbox{sign}}
is definitely wrong, \newcommand{\sign}{\mbox{sign}\;} is even worse,
and only \newcommand{\sign}{\mbox{sign}\,} would provide
approximately correct spacing. Of course, you wouldn't provide proper
breaking of an inline formula at the end of a line, which would
require (I think) that \sign be properly defined as a \mathop; and
that wouldn't provide proper spacing either before an opening
delimiter (of type \mathopen), in which case there is zero space
between the log-like function and the delimiter.

Hence, of course, DEK was perfectly right, as always, to make things
as apparently complicated as he did.

Thanks again, for the very fast responses to this OT question,

And Season Greetings,

Bruno