Saturday, June 9, 2012

Wrap list around a figure

I often had a need for a way to wrap a list around a figure in the past and hadn't quite found out. Wrapfig and floatflt aren't compatible with lists and break the layout in very bad ways.

Approaches with 2 minipages or tabulars are just wrong, period. There is a new package called cutwin, that you can combine with parshape (or use it without) to coerce your text to do something similar to what ultimately wrapfig should do. I didn't get it to work properly with my ams doc, which is kind of sad. I get the feeling their way of building lists is incompatible with the rest of the latex world :/.

Then i found a solution in some mean way to use minipage. It was still wrong because the type area is so different with ams but after a bit of fiddling with my stuff this works:

\begin{enumerate} 
\item some text
% Rest of old \item
\par
% New \item starts here!
\noindent\begin{minipage}{.88\textwidth}
 \begin{wrapfigure}{r}{.3\textwidth}
   \centering
     \includegraphics[width=.29\textwidth]{pic}
  \end{wrapfigure}
\item[ad d)]
\end{minipage}
\end{enumerate}

Looks really wrong, but does the right thing. Hope this helps someone. I sure would have liked to find this.

No comments:

Post a Comment