I sometimes see \smash used to control local vertical alignment. Which package defines it?
Asked
Active
Viewed 1.4k times
17
Roly
- 4,221
- 4
- 26
- 56
2 Answers
20
The \smash command is active by default. No package needed.
% arara: pdflatex
\documentclass{article}
\begin{document}
xxx
\fbox{\rule{1cm}{2cm}}
\fbox{\rule[-1cm]{1cm}{2cm}}
\fbox{\smash{\rule{1cm}{2cm}}}
\fbox{\smash{\rule[-1cm]{1cm}{2cm}}}
\fbox{\raisebox{0pt}[0pt][0pt]{\rule[-1cm]{1cm}{2cm}}}
\fbox{\raisebox{-1cm}[0pt][0pt]{\rule{1cm}{2cm}}}
\end{document}

LaRiFaRi
- 43,807
amsmathormathtoolsas the answer. So, one reason for asking this question is to generate a reliable search result for future reference. Plus I still haven't worked it out myself yet :) – Roly Apr 16 '14 at 07:28amsmathredefines\smashto accept an optional argument in order to be able to smash only the height or the depth of the box. – egreg Apr 16 '14 at 09:50