18

I sometimes see \smash used to control local vertical alignment. Which package defines it?

2
  • 3
    To clarify: Googling for "latex which package defines smash" might lead one to suspect amsmath or mathtools as 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 :) Commented Apr 16, 2014 at 7:28
  • 7
    amsmath redefines \smash to accept an optional argument in order to be able to smash only the height or the depth of the box. Commented Apr 16, 2014 at 9:50

2 Answers 2

18

\smash is a macro defined in both plain TeX and the LaTeX kernel.

You don't need to load any package to use it.

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

enter image description here

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.