Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Which one is correct?

p_1

or

p_1^{}

enter image description here

share|improve this question
3  
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 '13 at 9:27
10  
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 '13 at 9:58
add comment

1 Answer 1

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:

enter image description here

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.

share|improve this answer
    
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 '13 at 16:42
1  
I would choose \vphantom in this situation –  kahen Feb 6 '13 at 16:47
    
You are right, I forgot the 'v' :-) –  zunbeltz Feb 6 '13 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 '13 at 19:43
1  
Isn't a TeX user a perfectionist by definition? :-) –  zunbeltz Feb 7 '13 at 9:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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