# Top Vertical Alignment with Multirow

How can I align the contents of a multirow cell top the top?

Here's an MWE:

\documentclass{article}
\usepackage{array,multirow,booktabs,fullpage}

\begin{document}\begin{center}
\begin{tabular}{c>{\bfseries}l>{\itshape}clc>{\bfseries}l>{\itshape}cl}
\toprule
\multirow{1}{*}{\LARGE\bfseries A} & foo  & n. & lorem ipsum dolor sit &
\multirow{1}{*}{\LARGE\bfseries B} & foo  & n. & consectetur adipiscing elit \\
& bar  & v. & Maecenas sed purus       & & bar  & v. & at ipsum placerat luctus \\
& baz  & p. & Nullam luctus id tellus  & & baz  & p. & Ut ac ultricies neque \\
& qux  & v. & Aenean consequat commodo & & qux  & v. & in sodales metus ultrices \\
& buux & n. & Phasellus tincidunt      & & quux & n. & vitae pulvinar nisi mollis \\
\bottomrule
\end{tabular}\end{center}\end{document}


As you can see, what I've done is use the multirow command, but only set a row span of 1. This more or less gets me what I want: "hanging" letters, but with a couple of costs. First, I get a lot of Overfull \vbox warnings. The second is that the tops of the large letters are not actually precisely aligned:

I just uploaded a new version of multirow to CTAN. It should be available in a few days. If you want it now, just send me an email (you can find a working email address in multirow.sty).

With the new version you can give a positioning parameter [t] to \multirow to give it a top alignment. However, this will align the baselines of the letters, not the top. To align the tops you have to give it a fixup argument, that is the difference of the heights of the A and the f. This can be done as follows:

\usepackage{calc}
\newlength{\shiftdown}
\setlength{\shiftdown}{\heightof{f}-\heightof{\LARGE\bfseries A}}


and then

\multirow[t]{5}{*}[\shiftdown]{\LARGE\bfseries A} & foo  & n. & lorem ipsum dolor sit &
\multirow[t]{5}{*}[\shiftdown]{\LARGE\bfseries B} & foo  & n. & consectetur adipiscing elit \\


multirow command has two optional parameters:

\multirow{nrow}[njot]{width}[vmove]{contents}


the second one vmove helps you to adjust the vertical alignment.

\documentclass{article}
\usepackage{array,multirow,booktabs,fullpage}

\begin{document}\begin{center}
\begin{tabular}{c>{\bfseries}l>{\itshape}clc>{\bfseries}l>{\itshape}cl}
\toprule
\multirow{1}{*}[2pt]{\LARGE\bfseries A} & foo  & n. & lorem ipsum dolor sit &
\multirow{1}{*}[2pt]{\LARGE\bfseries B} & foo  & n. & consectetur adipiscing elit \\
& bar  & v. & Maecenas sed purus       & & bar  & v. & at ipsum placerat luctus \\
& baz  & p. & Nullam luctus id tellus  & & baz  & p. & Ut ac ultricies neque \\
& qux  & v. & Aenean consequat commodo & & qux  & v. & in sodales metus ultrices \\
& buux & n. & Phasellus tincidunt      & & quux & n. & vitae pulvinar nisi mollis \\
\bottomrule
\end{tabular}
\end{center}
\end{document}


• Is there a way to calculate the vmode parameter, so that its value is a function of the size of the font? I want to be able to generalize the code as much as possible. – Kevin Keith Sep 27 '16 at 8:33
• @KevinKeith Sorry, but I don't know any automatic solution. – Ignasi Sep 27 '16 at 10:01