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.

When I do:

\vec{p_{\bar p}}

I get:

strange rendering

instead of

proper-ish rendering

with the \vec shifted over a bit. Why does this happen?

(Also, \vec{\mbox{p_{\bar p}}} renders identically, even though \mbox{p_{\bar p}} looks fine, which clashes with my previous mental model of \mbox – I thought that things outside the box don't really affect things inside the box; guess I'm wrong.)

share|improve this question
1  
Use \vec{p}_{\bar p} –  Marco Daniel Mar 6 '12 at 18:11
1  
@MarcoDaniel: now you win! Its a tie! –  Gonzalo Medina Mar 6 '12 at 18:12
    
Sorry, I guess I wasn't quite clear. That's how I got my second image, but what if I want the \vec arrow to be shifted to the right to be centered over the entire p_p "block"? –  Ben Alpert Mar 6 '12 at 18:13
    
(Also not suggesting that this would be the best way to typeset this, but I'm wondering why what I tried breaks.) –  Ben Alpert Mar 6 '12 at 18:14

1 Answer 1

up vote 10 down vote accepted

This seems connected to the bug already examined in the question Why do arguments to nested \tilde or \breve commands reappear when amsmath is used?

Indeed, if amsmath is not loaded, your code works fine.

The solution is to avoid nesting:

$\vec{p}_{\bar{p}}$

which is, in my opinion, more mathematically sound.

share|improve this answer
    
Gotcha, thanks for the explanation (both here and on the other question)! –  Ben Alpert Mar 6 '12 at 19:20

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.