[texhax] Strange behavior of \mathop

Uwe Lueck uwe.lueck at web.de
Wed Nov 10 12:24:12 CET 2010

> Michael Barr  writes:
>> I was vaguely aware that \mathop sometimes lowers its argumet, but I was

... or better, the argument is *centered*, if it produces (contains) 
a single glyph, according to rule 13 of TeXbook Appendix G. Try

    x $\mathop{E}$ x $\mathop{e}$ x

-- the `E' is lowered, the `e' is raised (at least with me).

By contrast, if there is something more in \mathop{...} besides a symbol, 
the symbol is placed like text, its baseline just on the surrounding 
baseline. That's why "max" and "sin" within \mathop{...} are not centered, 
but typeset as text, baseline on baseline, as we expect it.

>> unprepared for this.  Look at the following two, nearly identical files,
>> paying close attention to the vertical placement of the bold "E"s.
>> \documentclass[12pt]{article}
>> \def\E{\mathop{\bf E}}
"Donald Arseneau" <asnd at triumf.ca>, 09.11.2010 22:05:18:
> Use \mathbf{E} instead of the LaTeX 2.09 \bf, and all is consistent.
> The old-style font commands introduce spurious {} for the first
> instance at a particular size, so your E is not a single char.
> That is bug "latex/3357 (2001-08-04): font commands give {} in math mode"
> that was never fixed (even though I submitted a patch with the report).

I.e. (for "laymen" as I was one a few minutes ago): 
because the first appearance of \mathop{\bf E} adds some `{}' to the `E', 
it is *not* centered. It is centered the next times. Enjoy

    x $\mathop{e} \mathop{E}$ 
    x $\mathop{{}e} \mathop{{}E}$ 
    x $\mathop{e{}} \mathop{E{}}$ x

I discover that that bug report (whose original content I cannot see 
on the bugs database) seems not to be entirely correct. 
The bug occurs with \bf, \it, \sf, \tt, but not with \rm, try 

    x $\mathop{\bf E} \mathop{\bf E}$ 
    x $\mathop{\it E}$ x $\mathop{\it E}$ 
    x $\mathop{\rm E} \mathop{\rm E}$ 
    x $\mathop{\sf E} \mathop{\sf E}$ 
    x $\mathop{\tt E} \mathop{\tt E}$ 



More information about the texhax mailing list