4

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

enter image description here

1 Answer 1

2

Try something along these lines:

\documentclass{article}

\begin{document}

\begin{enumerate}
\item 
\begin{minipage}[t]{0.2\linewidth}
  \vspace{-\baselineskip}
  \rule{\textwidth}{3cm}
\end{minipage}\hfill
\begin{minipage}[t]{0.7\linewidth}
  \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}

enter image description here

Using \vspace{0pt} is a nice trick which allows the two minipages 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 the minipage for the figure to create an empty first line and then insert a negative space. The second minipage is just left as you would normally write it. Thus for the second minipage you get the correct alignment with the \item.

3
  • Well, that was easy! Commented Oct 20, 2013 at 20:29
  • @ChrisChudzicki There's a \par after the \paragraph that doesn't appear to be doing anything. What was your intention? Commented Sep 6, 2017 at 23:10
  • @GeoffPointer Hmmm, I don't know why it's there. That example isn't mine, it's borrowed from tex.stackexchange.com/q/11630/27666 Commented Sep 7, 2017 at 11:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .