# Enforcing baseline alignment for multiple overbraces in math mode

What is the easiest way to vertically align overbraces in math? In the following example...

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

\begin{math}
*(m, n) = (\overbrace{n - m}^\text{index}, \overbrace{\sum_{k=m}^{n-1}{\pi_{i_k}}}^\text{sum})
\end{math}

\end{document}


...because the second tuple element has greater vertical extent (due to the summation), the brace appears higher than the other one. I would like to have "index" and "sum" on the same baseline:

-

Perhaps easiest is to use \vphantom to make a strut the size of the larger expression

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

\newcommand\suma{\sum_{k=m}^{n-1}{\pi_{i_k}}}
\begin{math}
*(m, n) = (\overbrace{\vphantom{\suma}n - m}^\text{index}, \overbrace{\suma}^\text{sum})
\end{math}

\end{document}

-
Excellent...... –  Emit Taste Mar 9 '13 at 17:21