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.

How to put a big bracket under different parts of a equation so that I could write e.g. a text specific to that part in the equation?

For example :

f =  x^3 +  2
    |___|  |__| 
      |     |
   text 1  text 2
share|improve this question

migrated from stackoverflow.com Feb 17 '12 at 4:20

This question came from our site for professional and enthusiast programmers.

    
Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. –  Werner Feb 17 '12 at 4:47

3 Answers 3

Since the text used in \underbrace (or \overbrace) is typically set in a different font size to not distract further from the equation, it is preferable to use amsmath's \text macro.

enter image description here

\documentclass{article}
\usepackage{amsmath}% http://ctan.org/pkg/amsmath
\begin{document}
\[
  f(x) = \underbrace{(x+2)^3}_\text{text 1} + \overbrace{(x-3)}^\text{text 2}
\]
\end{document}
share|improve this answer
    
Would you still use \text if you wanted to include math? e.g., instead of "text 1" I want to have something like $g(x)$. (Also, congrats on your 1000th answer. Awesome work!) –  Mike Wierzbicki Feb 17 '12 at 6:12
    
@MikeWierzbicki: Thanks - 1000! No, if you use math, then you would not use \text, since math will automatically size to the appropriate font size. The switching of mode (from math to text) causes default settings to be invoked, setting text in \normalsize rather than \scriptsize. amsmath's \text chooses the appropriate text font size via \mathchoice. –  Werner Feb 17 '12 at 6:28

What you want is

f = \underbrace{x^3}_\textrm{text 1} + \underbrace{2}_\textrm{text 2}
share|improve this answer

You would find it out in the mathmode manual or symbols manual.

share|improve this answer
1  
Please provide hyperlinks for the manuals. Not everybody may know where to find them. (I've added them for you.) Also you should consider providing more information. The poster may not know what to look for. –  Marc van Dongen Feb 17 '12 at 7:53

Your Answer

 
discard

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