4

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

1 Answer 1

4

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .