CERN Accelerating science

This website is no longer maintained. Its content may be obsolete. Please visit http://home.cern/ for current CERN information.



next up previous
Next: Placing parboxes and Up: LaTeXeAn Overview Previous: Page Markup---Several Kinds

Moving boxes

Boxes can be moved up or down by the command:

\raisebox{lift}[depth][height]{contents}

The simple example below shows its principle of use.

\begin{flushleft}
x111x \raisebox{-1ex}{downward} x222x     \\ 
x333x \raisebox{1ex}{upward} x444x        \\ [1em]
x111x \raisebox{-1ex}[0cm][0cm]{downward} x222x\\ 
x333x \raisebox{1ex}[0cm]{upward} x444x
\end{flushleft}

A more useful example is the generation of text ``between'' two rows in a table (by ``hiding'' the boxes' content from TeX.)

\begin{center}
\begin{tabular}{|c|c|c|}               \hline
         & \multicolumn{2}{c|}{title}\\ \cline{2-3}
\raisebox{1.5ex}[0cm][0cm]{100}
         & A         & B             \\ \hline
20000000 & 10        & 10            \\ \hline
\end{tabular}
\end{center}

Finally, when your printer driver allows it, you can rotate boxes. In this case the use of the various box dimension parameters becomes apparent.

\newcommand{\DoT}[1]{\begin{turn}{45}#1\end{turn}}
x1 \DoT{\fbox{Not so Good.}} x2 
\DoT{\raisebox{\depth}{\fbox{I like it.}}} x3
\DoT{\raisebox{-\height}{\fbox{Bad Choice.}}} x4



Janne Saarela
Wed May 17 14:38:58 METDST 1995