@egreg gave a very nice and thorough answer to What are the different kinds of boxes in (La)TeX?. It seems it would be nice to have a similarly thorough answer to controlling spacing.
I'm not thinking so much about
\vspace
\hspace
\\[<dim>]
and their starred variants because there is a very thorough answer about such spacing commands found at What commands are there for horizontal spacing? At least in terms of horizontal spacing.
I'm thinking more along the lines of such things as
\llap
\rlap
\clap
\smash
\mathllap
\mathrlap
\mathclap
And the phantoms:
\phantom
\hphantom
\vphantom
And I'm sure I've forgotten a few.
What would be nice in addition is to not only have some kind of an explanation of the uses and differences of these commands but also a pointer to where someone can find documentation for them. For example,
I know I can do texdoc mathtools
and find documentation for \mathllap
etc. But I don't know where to find documentation for \smash
and the various phantoms.
EDIT
Sometime I don't always get the result I expect
For example, \phantom
doesn't always behave like I would like such as in this example,
\documentclass{article}
\usepackage{amsmath,amssymb}
\pagestyle{empty}
\begin{document}
\begin{align*}
y &= x - z\raisebox{0ex}[0pt][0pt]{\rule[-4ex]{0.1pt}{4ex}} \\
&= x \mathop{\phantom{-}} z\raisebox{0ex}[0pt][0pt]{\rule{0.1pt}{4ex}} \\
&= x \phantom{ - } z \\
\end{align*}
\hspace*{\fill}Or even worse:\hspace*{\fill}
\begin{align*}
y &= x - z\raisebox{0ex}[0pt][0pt]{\rule[-4ex]{0.1pt}{4ex}} \\
&\phantom{= x -} z\raisebox{0ex}[0pt][0pt]{\rule{0.1pt}{4ex}} \\
\end{align*}
\end{document}
\vspace
and\hspace
and while it does mention\hphantom
it doesn't mention\llap
and the rest. I'd say my question falls somewhere between the link about boxes and your suggested duplicate.\smash
is defined intex/plain/base/plain.tex
and does get redefined byamsmath
(to accept an optional argument). The phantom family,\llap
and\rlap
are also defined inplain.tex
.\clap
was born in a TUG article and is also defined bymathtools
.