I am trying to align a minipage
that has a list inside. Using a tabular
environment for the list results in the minipage ignoring the [t]
option (or any other, as far as I can tell). On the other hand, using a description
environment yields the correct result, but I don't like how it aligns the item[]
s with different length, and so would prefer using the tabular.
MWE:
\documentclass{article}
\begin{document}
\textbf{One set of notes.}
\begin{minipage}[t]{0.5\linewidth}
\begin{tabular}{@{}r@{ }l@{}}
Note 1: & This is the first note \\
Note 2: & This is the second note \\
Note 3: & This is the third note \\
Note 4: & This is the fourth note \\
\end{tabular}
\end{minipage}
\textbf{Another set of notes.}
\begin{minipage}[t]{0.5\linewidth}
\begin{description}
\item[Note 1:] This is the first note \\
\item[Note 2:] This is the second note \\
\item[Note 3:] This is the third note \\
\item[Note 4:] This is the fourth note \\
\end{description}
\end{minipage}
\end{document}
The result is shown in the image at the bottom.
Is there a way of using a tabular
inside a minipage
that acknowledges the vertical alignment?
Best Answer
The
[t]
op alignment of theminipage
aligns it's content at the top of the anchor point of theminipage
interior. Since theminipage
interior has an anchor point in the middle - given by thetabular
block, theminipage
"top" results in the (vertical) middle of the block.To avoid this, specify the
tabular
anchor point as being[t]
op as well:Since there are known problems with baseline settings in
minipage
/\parbox
boxes, you may be better off setting the entireminipage
-tabular
combination in a nestedtabular
:I've inserted a
tabularx
inner to allow for a fixed-width0.5\linewidth
structure.