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.
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}
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:
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
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP