Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

up vote 55 down vote accepted

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

share|improve this answer
8  
It would be better to use \text{$=0$, since...}. –  Gonzalo Medina Sep 30 '11 at 18:56
2  
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}

enter image description here

share|improve this answer
    
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
1  
@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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.