8

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.)

egreg
  • 1,121,712
Sophie Alpert
  • 15,550
  • 9
  • 37
  • 37

1 Answers1

10

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.

egreg
  • 1,121,712