How can I get text underneath an underbrace?
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}
For example, if you want to scale the font in the \underbrace
, you could use (say) \underbrace{...}_{\text{\normalfont ...}}
:
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}
Modifying the width and depth/height is also possible using \underbracket[<width>][<depth>]{<stuff>}
or \overbracket[<width>][<height>]{<stuff>}
.
In addition to the \underbrace
and \underbracket
commands provided by the amsmath
and mathtools
packages, respectively, I think it's also worth knowing about the \undercbrace
command, provided by the mtpro2
package, to generate a "curly" underbrace that can be up to 10cm (4 inches) wide.
The downside of using the mtpro2
package -- other than the fact that it's not entirely free, but is available at a very reasonable cost -- is that it uses a "Times Roman"-style font rather than the Computer Modern font. Of course, the non-use of Computer Modern needn't be a downside at all. :-)
The following MWE illustrates how the mtpro2
curly underbrace differs from the "regular" or "straight" underbrace provided by the amsmath
package.
\documentclass{article}
\usepackage{amsmath,times,mtpro2} %% times package needed only to load TNR text font
\begin{document}
\[
\undercbrace{u'-P(x)u^2-Q(x)u-R(x)}_{\text{$=0$ since~$u$ is a particular solution.}}
\]
\[
\underbrace{u'-P(x)u^2-Q(x)u-R(x)}_{\text{$=0$ since~$u$ is a particular solution.}}
\]
\end{document}