Alignment of rotatebox by baseline

alignmentrotatingtables

When I try to use several ±90° \rotateboxes one below the other, they are misaligned due to ascenders and descenders causing different sizes of boxes, as demonstrated below. How can I align them correctly? One workaround is demonstrated in my answer below, but I’m sure there is a better way.

I need this for setting rotated labels with bigdelim in tables.

\documentclass{article}

\usepackage{graphicx}

\begin{document}

\rotatebox{90}{peon}

\rotatebox{90}{eon}

\rotatebox{90}{lion}

\rotatebox{-90}{peon}

\rotatebox{-90}{eon}

\rotatebox{-90}{lion}

\end{document}

wrong alignment

Best Answer

Another possible solution is add \strut to \rotatebox:

\documentclass{article}
\usepackage{graphicx}

\begin{document}

\rotatebox{90}{peon\strut}

\rotatebox{90}{eon\strut}

\rotatebox{90}{lion\strut}

\rotatebox{-90}{peon\strut}

\rotatebox{-90}{eon\strut}

\rotatebox{-90}{lion\strut}

\end{document}

enter image description here

Related Question