2

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?

LondonRob
  • 4,422

2 Answers2

4

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.

Harald
  • 1,349
  • 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 -> http://tex.stackexchange.com/questions/171776 – Harald Nov 24 '14 at 13:25
  • 1
    @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
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}
David Carlisle
  • 757,742