1

I'm using \overbrace to explain a part of an equation, like this:

\begin{align}
a\left[\frac{d\cos y}{e} + \overbrace{\frac{b\sin x}{c}}^{\text{second bit}}\right]
\end{align}

But the overbrace increases the height of the brackets unnecessarily:

Brackets extended unnecessarily

Really, what I'd like is for the height of the brackets to be unrelated to the overbrace, like this:

Brackets correct height

Is this possible?

3

enter image description here

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
a\Bigl[\frac{d\cos y}{e} + \overbrace{\frac{b\sin x}{c}}^{\text{second bit}}\Bigr]
\end{equation}
\end{document}
  • See section 6 of the AMS Short Math Guide for more on Bigl and family. – LondonRob Nov 24 '14 at 12:25
  • unfortunately, the space before the closing bracket is a bit wider than what would look best. – barbara beeton Nov 24 '14 at 13:34
  • @barbarabeeton for you, a \! – David Carlisle Nov 24 '14 at 13:48
2

You can often literally smash the part which fiddles with your desired height :)

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation}
a\left[\frac{d\cos y}{e} + \smash{\overbrace{\frac{b\sin x}{c}}^{\text{second bit}}}\right]
\end{equation}
\end{document}

This comes closer to the posted intended output than David's answer, concerning the size of the brackets. \smash is a macro defined in both plain TeX and the LaTeX kernel. It reduces the height of its arguments to zero.

  • This looks interesting. Would you mind adding a bit of explanation, perhaps with a link to something to read about smash? – LondonRob Nov 24 '14 at 13:21
  • Added a little explanation. More details can also be found there -> tex.stackexchange.com/questions/171776 – Harald Nov 24 '14 at 13:25
  • @LondonRob Note though that this completely hides the brace so it will over-print any text before the equation unless you add a \vspace to make some room. – David Carlisle Nov 24 '14 at 13:47
  • @DavidCarlisle a very important consideration! – LondonRob Nov 24 '14 at 13:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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