TransWikia.com

Multiple text lines below underbrace without additional horizontal space

TeX - LaTeX Asked by Author on August 5, 2021

How to create a bracket with multiple lines of text and avoiding insertion of additional horizontal space?
I am able to create either a single line text without additional horizontal space or multi-line text with horizontal space. To achieve multiple lines without horizontal space I tried in several ways to combine makebox and substack but there is always an error message.

enter image description here

documentclass{report}
usepackage{amsmath}
begin{document}  
begin{align}
X &= underbrace{abcde}_{text{makebox[0pt][c]{single text line without space}}} cdot f 
X &= underbrace{abcde}_{substack{text{multiple text lines lead} text{to additional space}}} cdot f
end{align}
end{document}

One Answer

Set the multi-line sub-stack in a zero-width box that retains the math size before using substack; mathtools provides mathclap that does this:

enter image description here

documentclass{article}

usepackage{mathtools}

begin{document}

begin{align*}
  X &= underbrace{abcde}_{mathclap{text{single text line without space}}} cdot f 
  
  X &= underbrace{abcde}_{mathclap{substack{text{multiple text lines lead}  text{to additional space}}}} cdot f
end{align*}

end{document}

Correct answer by Werner on August 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