TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

enter image description here

share|improve this question
up vote 5 down vote accepted

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

enter image description here

\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}
share|improve this answer
    
Excellent...... – Emit Taste Mar 9 '13 at 17:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.