I have a figure and text inside a minipage
inside an enumerate
. I would like align the text and the item
number and top-align the figure and the text.
Top top-align figures and text in the past I have used the \vspace{0pt}
solution mentioned in Aligning image and text on top, with minipages but this fails to align with the item
number.
This question seems relevant: Alignment of item number in list containing a minipage
I have tried and failed to adapt egreg's solution. I would also prefer not do define a whole new minipage environment, if possible.
\documentclass{article}
\begin{document}
\begin{enumerate}
\item
\begin{minipage}[t]{0.2\linewidth}
\vspace{0pt}
\rule{\textwidth}{3cm}
\end{minipage}\hfill
\begin{minipage}[t]{0.7\linewidth}
\vspace{0pt}
\paragraph{Ludwig Boltzmann (1844~V1906)}\par
He was an Austrian physicist famous for his founding contributions in the
fields of statistical mechanics and statistical thermodynamics. He was
one of the most important advocates for atomic theory at a time when that
scientific model was still highly controversial.
\end{minipage}
\item
\item
\end{enumerate}
\end{document}
which produces
Best Answer
Try something along these lines:
Using
\vspace{0pt}
is a nice trick which allows the twominipage
s to be aligned on their first line. But when you're doing that, you're creating an empty first ilne for the alignment to occur on.So, my approach here is to use
\vspace{-\baselineskip}
in theminipage
for the figure to create an empty first line and then insert a negative space. The secondminipage
is just left as you would normally write it. Thus for the secondminipage
you get the correct alignment with the\item
.