# Weird relative positioning of superscript and subscript with \dot, \bar

Minimal working example:

\documentclass[12pt]{article}
\usepackage{amsmath}

\begin{document}

${A^\mu}_\nu$
${\bar{A}^\mu}_\nu$

\end{document}


The result is.

Why is the placement of upper and lower indices in the second one wrong?

From the TeXbook, p. 290:

A <math field> is used to specify the nucleus, superscript, or subscript of an atom. When a <math field> is a <math symbol>, the f and a numbers of that symbol go into the atomic field. Otherwise the <math field> begins with a {, which causes TeX to enter a new level of grouping and to begin a new math list; the ensuing <math mode material> is terminated by a }, at which point the group ends and the resulting math list goes into the atomic field. If the math list turns out to be simply a single Ord atom without subscripts or superscripts, or an Acc whose nucleus is an Ord, the enclosing braces are effectively removed.

So in the first example

${A^\mu}_\nu$


the <math field> is A^\mu which has a superscript, so the braces are not removed. In the second example,

${\bar{A}^\mu}_\nu$


we are in the other situation, because \bar{A} is an Acc atom. So the braces are removed and ineffective.

Why did Knuth choose to do this? I don't really know, but the main reason could be the connected to making double accents. In a case such as

\bar{\bar{A}^\mu}


one would like to put the second bar over \bar{A}, rather than over the whole subformulas. Actually the Plain TeX macros don't easily allow for making double math accents, problem which is solved by amsmath.

the question is not why is the positioning of the subscript "wrong" in the second example, but why is it the way it is in the first.

in "normal" circumstances, the positioning of the subscript in the second is what is wanted, not the "offset" arrangement -- unless you're indicating a tensor, in which case the order and position is different.

clearly, you want the offset. this input will give that result:

$\bar{A}^\mu{}_\nu$


in fact, the {} pair (called an "empty group") is the preferred method of obtaining the offset even in the first case:

$A^\mu{}_\nu$


i'll have to leave it to someone else to say why there isn't any offset with your second example.