16

Is there a vertical equivalent of \mathclap, i.e. a command that will ,,crush`` part of a formula to height zero, allowing better alignment with other parts of the same formula?

To illustrate what I want to achieve, consider the following (largely made-up) MWE:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
    \begin{align*}
        A \begin{pmatrix}
            x \\ y \\ z
        \end{pmatrix} 
        & = 
        u \cdot \left( \text{some rather long term} \right) \\
        & = 
        v \cdot \left( \text{another rather long term} \right) \\
        & = 
        w \cdot \left( \text{a third rather long term} \right)
    \end{align*}
\end{document}

which gives

enter image description here

whereas would I'd like to achieve is

enter image description here

(I personally think that's more readable; YMMV, of course).

Is this possible, and if so, how? I've done some superficial research but came up empty-handed.

chsk
  • 3,667

1 Answers1

16

The vertical equivalent of \mathclap{...} is \smash{...}. \smash is available in both PlainTeX and LaTeX.

If you load the amsmath package, you will also get \smash[b]{...} and \smash[t]{...}. These commands set the depth and height of their arguments to zero. (One could say that they're somewhat similar in function to \mathrlap and \mathllap. But not perfectly equivalent, for sure.)

For the case of your sample code, then, you will want to replace

A \begin{pmatrix} x \\ y \\ z \end{pmatrix}

with

A \smash[b]{\begin{pmatrix} x \\ y \\ z \end{pmatrix}}
Mico
  • 506,678