TransWikia.com

How do I put big brackets under different parts of an equation to attach text labels?

TeX - LaTeX Asked by user576654 on April 5, 2021

How do I put big brackets under different parts of an equation so that I can write, e.g., text specific to these parts?

For example:

f =  x^3 +  2
    |___|  |__| 
      |     |
   text 1  text 2
      

3 Answers

What you want is

f = underbrace{x^3}_textrm{text 1} + underbrace{2}_textrm{text 2}

Answered by Tristan on April 5, 2021

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

Answered by user590212 on April 5, 2021

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}
usepackage{mathtools}% Loads amsmath
begin{document}
[
  f(x) = 
    underbrace{(x + 2)^3}_text{text 1} + 
    bigl(
      mathrlap{overbrace{phantom{(c - 2d)}}^{text{text 2}}}
      (c - 
      mathrlap{underbrace{phantom{2d) + (3e}}_{text{text 3}}}
      2d) +
      overbrace{(3e - 4f)}^{text{text 4}}
    bigr) + 
    overbrace{(x - 3)}^text{text 5}
]
end{document}

The difficult overlapping braces uses math overlaps from mathtools. It follows a process of setting the over-/underbrace text first with a phantom base, after which the base (or part thereof) is re-set. However, if those aren't needed, using amsmath only would suffice for usage of text.

There are a number of ways of achieving the overlapping output. Another method of overlapping braces is discussed in section 63.2 Overlapping braces of the mathmode document.

Answered by Werner on April 5, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP