[Tex/LaTex] How to get text underneath an underbrace

amsmathbracesmath-modevertical alignment

I am looking to do something of the following:

formula with underbrace

To get text underneath the underbrace. Is it involving \stackrel or some sort of similar command?

Best Answer

The amsmath package provides \text{<stuff>} that typesets <stuff> in text mode, while still respecting the relative font size:

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
\[
\underbrace{u'-P(x)u^2-Q(x)u-R(x)}_{\text{=0, since~$u$ is a particular solution.}}
\]
\end{document}

Underbrace with text

For example, if you want to scale the font in the \underbrace, you could use (say) \underbrace{...}_{\text{\normalfont ...}}:

Underbrace with normal sized font

Although the spacing is different, math expressions (regardless of its simplicity) are usually better typeset in math mode. Consequently, you could also use \text{$=0$, since...} as suggested by @Gonzalo.


Other bracing commands also exist and is provided by the mathtools package. For example, the following example illustrates the use of \underbracket:

\documentclass{article}
\usepackage{mathtools}% http://ctan.org/pkg/mathtools
\begin{document}
\[
\underbracket{u'-P(x)u^2-Q(x)u-R(x)}_{\text{=0, since~$u$ is a particular solution.}}
\]
\end{document}

Underbracket as provided by mathtools

Modifying the width and depth/height is also possible using \underbracket[<width>][<depth>]{<stuff>} or \overbracket[<width>][<height>]{<stuff>}.