Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer
    
Well, that was easy! –  mrc Oct 20 '13 at 20:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.