# How can I get text underneath an underbrace?

I am looking to do something of the following:

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

-

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>}.

-
It would be better to use \text{$=0$, since...}. – Gonzalo Medina Sep 30 '11 at 18:56
Thought about it, but it didn't match the spacing supplied by the OP. I'll leave it for interpretation of the user. – Werner Sep 30 '11 at 19:01

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 curly underbrace differs from the "regular" underbrace provided by the amsmath package. (The .png image makes the braces look jagged -- this isn't the case in the original pdf file.)

\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}


-
Thanks Mico, that a new package I'm going to look into that I have not wandered in yet. Useful to know info. – night owl Oct 1 '11 at 23:03
@nightowl - There are two reasons (in my mind) for becoming familiar with the MathTime Pro package. First, when Times New Roman (TNR) is scaled down to script- and scriptscript-sizes, the glyphs look downright skinny, making TNR's use for heavy-duty math typesetting rather problematic. Second, TNR's "big" sum and integrals symbols are also rather unattractive. MathTime Pro provides well-proportioned large operators and has two optical sizes below "regular" text size, making its math output very legible. Its "curly" big vertical and horizontal braces are nice but probably not as crucial... – Mico Oct 2 '11 at 0:18
Mico, so to get it straight with mtpro2 package. The use for it is when using very large sized math operators such as summations or integral signs and things such as this, correct? – night owl Oct 3 '11 at 3:37
@nightowl: I'd say that if you need to use a TNR text font, there are (at least) two very good reasons for considering the mtpro2 package rather than, say, matptmx or txfonts, for matching math fonts: (a) good-looking "large" math operators and (b) special designs for characters for first- and second-order subscripts to avoid anorexic-looking glyphs. – Mico Oct 3 '11 at 10:24