[Tex/LaTex] overset text over equal sign in in an Align environment

alignamsmathequationsmath-mode

Look at the following example

\begin{align}
     & x \\
     \overset{\text{some long explanation}}= & foo \\
     & = bar
\end{align}

what is the best way to get the equal signs aligned? Now I have seen different solution such as adding \overset{\hphantom{\ţext{some long explanation}}}= to the beginning of every line, but I don't really think that is the best solution.
Any better ideas?


UPDATE

I guess what i am actually after is

  1. aligning the first column of the align environment right
  2. aligning the equal sign under the overset text right

Best Answer

\documentclass{article}
\usepackage{mathtools}
\begin{document}

\begin{align}
  x & \\
    &\overset{\mathclap{\strut\text{some long explanation}}}= foo\\
    & = bar
\end{align}

\end{document}