W3cubDocs

/LaTeX

\raisebox

Synopsis, one of:

\raisebox{distance}{text}
\raisebox{distance}[height]{text}
\raisebox{distance}[height][depth]{text}

Raise or lower text. This command is fragile (see \protect).

This example makes a command for denoting the restriction of a function by lowering the vertical bar symbol.

\newcommand*\restricted[1]{\raisebox{-.5ex}{$|$}_{#1}}
$f\restricted{A}$

The first mandatory argument distance specifies how far to raise the second mandatory argument text. This is a rigid length (see Lengths). If it is negative then it lowers text. The text is processed in LR mode so it cannot contain line breaks (see Modes).

The optional arguments height and depth are dimensions. If they are specified, they override the natural height and depth of the box LaTeX gets by typesetting text.

In the arguments distance, height, and depth you can use the following lengths that refer to the dimension of the box that LaTeX gets on typesetting text: \depth, \height, \width, \totalheight (this is the box’s height plus its depth).

This will align two graphics on their top (see Graphics).

\usepackage{graphicx,calc}  % in preamble
   ...
\begin{center}
  \raisebox{1ex-\height}{%
    \includegraphics[width=0.4\linewidth]{lion.png}}
  \qquad
  \raisebox{1ex-\height}{%
    \includegraphics[width=0.4\linewidth]{meta.png}}
\end{center}

The first \height is the height of lion.png while the second is the height of meta.png.

© 2007–2018 Karl Berry
Public Domain Software
http://latexref.xyz/_005craisebox.html