22

How can I set how much vertical spacing is put between my equation and the curly bracket used in underbrace?

As an example, I feel like the following just puts the brace too close to the equation:

\underbrace{c = a + b}_{\text{my equation}}

Many thanks...

2 Answers 2

23

You can put a \strut just before c to enlarge the depth of your equation and if you still find the curly bracket too close, you can also define your own "strut":

\documentclass{minimal}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\newcommand*\mystrut[1]{\vrule width0pt height0pt depth#1\relax}
\begin{document}
$\underbrace{c = a + b}_{\text{my equation}}$
$\underbrace{\strut c = a + b}_{\text{my equation}}$
$\underbrace{\mystrut{1.5ex}c = a + b}_{\text{my equation}}$
$\underbrace{\mystrut{2.5ex}c = a + b}_{\text{my equation}}$
\end{document}
7

The mathtools package has a very useful implementation of \underbracket and \overbracket that take two extra parameters: the gauge of the bracket and its distance from the text. From Sec. 3.3.2 (v. 1.10) of the package documentation:

\underbracket[〈rule thickness〉] [〈bracket height〉]{〈arg〉} 
\overbracket[〈rule thickness〉] [〈bracket height〉]{〈arg〉}

The 〈arg〉 can be of the form {bracketed matter}_{label} (or substituting ^ for _ in the case of \overbracket).

The documentation discusses infelicities of spacing in the traditional \underbrace and \overbrace, and seems to be saying that the package contains a revised from of these, as well. If so the revised versions do not seem to be as finely adjustable as \underbracket and \overbracket, and they are not documented in the documentation.

You must log in to answer this question.