[Tex/LaTex] \dot over \vec over : amsmath bug/feature

amsmath

I was trying to typeset the time derivative of \vec{r}_\alpha, and naively, I put it as an argument to \dot. This does not work: the arrow is not on r anymore. Here is a minimal example:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\dot{\vec{r}_\alpha}
\]
\end{document}

Note that there is a better way to typeset it (and it works): \dot{\vec{r}}_\alpha. I am asking out of curiosity.

Best Answer

Have a look at the mattens package. I have written it to "overcome" these problems

\documentclass{article}
\usepackage{mattens} % use [noformat] for non-bold symbols
\usepackage{bm}
\begin{document}
  $\aS[\Dot]{r}_\alpha$

  or some other examples where \TeX\ makes a real mess on its own

  $\bS[\Dot]{f}^i_j$
\end{document}