# Typesetting Subscript: Which is correct?

Which one is correct?

p_1

or

p_1^{}

-
If the second option were "correct" (whatever that means), wouldn't TeX be programmed to typeset it that way when you enter \$p_1\$? –  Ari Brodsky Feb 5 at 9:27
Neither is correct in all situations. It depends on the presence or absence of variables with superscripts and subscripts in the same formula. –  egreg Feb 5 at 9:58

Correct is a relative concept here. They are giving you different results. If you read the TeXbook then Don Knuth clearly intended to have the input syntax as concise as possible, i.e., I claim for most situations he would maintain that \$p_1\$ is the input that should be used.

However, as mentioned they produce different output, because the ^{} is seen as an existing superscript (a {} does in fact produce an Ord math atom) and then the placement is slightly changed for the subscript. So in a situation such as

\$p_1 = q_1^2\$

the 1 on the p would be placed slightly higher than the 1 on the q. If that bother you than you could trick TeX's rules in thinking there is a superscript by using an empty one, i.e., through

\$p_1^{} = q_1^2\$

But such a scheme would break down the moment the real superscript would be more complicated so that TeX would need more spreading to avoid super and subscript touching each other. E.g.,

\$p_1^{} = q_1^{2_p}\$

would again fail to get the exactly on the same height, though it is less visible than the first example.

The way for the perfectionist to fix even that (as suggested in a comment from @zunbeltz) is to use \vphantom which generates an Ord atom that has no width but the height and depth of its argument. But of course readability of the formula get even worse:

\$p_1^{\vphantom{2_p}} = q_1^{2_p}\$

Same kind of corrections could or would be needed in case you superscripts and superscripts + subscripts.

Here are the four examples each with some \hrule after it to spot what aligns at the bottom:

postscriptum: personally I find it a little disconcerning if subscripts (or superscripts) change vertical placement in some cases, not so much in the example above but when they appear fairly close to each other e.g., in \$a_1, b_2^2,c_3\$. But TeX is clearly not set up to make a change easy and even typing ^{} in such cases makes the input less readable. So I wouldn't fight it unless it really jumps into your eyes when you see it in print.

The is a way to get the subscripts placed lower by default by changing the font parameters in some math fonts (see TeXbook) but this is also a questionable solution since normally the default drop looks better.

-
You allways can use \phantom to align the subscripts like \$p_1^{\phantom{2_p}} = q_1^{2_p}\$. Isn't it? –  zunbeltz Feb 6 at 16:42
I would choose \vphantom in this situation –  kahen Feb 6 at 16:47
You are right, I forgot the 'v' :-) –  zunbeltz Feb 6 at 16:55
@zunbeltz you are right you can go to any detail with \vphantom and friends to add horizontal or vertical spacing but in a case like this example it would be really only for the the perfectionist, wouldn't it? Nevertheless you are right I should have mentioned that. –  Frank Mittelbach Feb 6 at 19:43
Isn't a TeX user a perfectionist by definition? :-) –  zunbeltz Feb 7 at 9:03