Why is {\vphantom{X}}^2 (%8) higher than any of the other options? In particular, why is it higher than %5, %6, and %7. The behavior is normal if I use a lower-case character instead of the X.



enter image description here

  • As opposed to {X}, which is a letter, the construct {\vphantom{X}} is an empty hbox with the width and depth of the letter X. I guess TeX treats these differently. Dec 31, 2015 at 20:42

2 Answers 2


For the same reason

\fbox{${\vphantom{X}}^{\rlap{\vrule height0pt depth0.1pt width 2cm}2}$}%


enter image description here

The rule is just to show the height is the same.

Actually the comparison should be with

\fbox{${\vphantom{X}}^{\rlap{\vrule height0pt depth0.1pt width 2cm}2}$}%

that yields the same output.

When TeX has to add a superscript to a box (and a subformula in braces containing more than a single math character counts as a box), it has no clue about what character to append the superscript to, only the box's height.

When you do \vphantom{X} in math mode, TeX builds a box with \setbox0=\hbox{$X$}, then sets \wd0=0pt and does \box0. Apart from setting the width, it's the same as doing \hbox{$X$}.

Appending a superscript field to a single math character is different, because now TeX knows much more about the object.

Let's examine a simpler case






The relevant bits of the log file are

....\hbox(4.51111+0.0)x4.48613, shifted -3.62892
.....\OT1/cmr/m/n/7 2


....\hbox(4.51111+0.0)x4.48613, shifted -4.36111
.....\OT1/cmr/m/n/7 2

If we add \showlists before the two closing $ characters, we get

### math mode entered at line 6
^\fam0 2

for the first formula and

### math mode entered at line 8
^\fam0 2

for the second formula. The difference is subtle: in the first case the superscript is appended to an empty \mathord atom, in the second case to the whole box.

  • I don't see how that explains the difference between %7 and %8. From what you write, \vphantom{X} is a box just like {\vphantom{X}} is.
    – mhchem
    Dec 31, 2015 at 21:24
  • @mhchem I added the analysis for that case too.
    – egreg
    Dec 31, 2015 at 21:37

This is just to summarize egreg's detailed analysis in my own words.

The effect is a combination of two things.

First, TeX can apply a superscript either to a character or a box. Character: it knows more and can place the superscript at a better position. Box: it knows nothing more than the dimensions of that box "(and a subformula in braces containing more than a single math character counts as a box)". This explains %5, %6, and %8.


enter image description here

Second, writing a superscript directly after a \vphantom somehow is not applied to that \vphantom. This explains %7.


enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.