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.

wrapfig is incompatible with the enumerate and itemize environments. Is there a typographical reason not to wrap a list around a figure or is it a technical limitation of LaTeX? If it is a technical limitation, is there any work (new packages or changes to LaTeX) currently being done to eliminate the limitation in the future?

Edit: To respond to some of the comments: I realize that there are "gymnastics" which can make this work. I do not have an example of the problem. Whenever I run into a problem with wrapfig because it is near an enumerate or itemize environment, I search for an easy solution, find none, and move the figure elsewhere. In the vast majority of cases, the cost of learning the complex solutions isn't worth the benefit of keeping the figure where I want it.

share|improve this question
    
It is would be helpful if you would compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. –  Peter Grill Jun 8 '12 at 18:44
2  
I have some thoughts for LaTeX3: currently we still need to do work on this, but I would expect 13galley to eventually cover this. –  Joseph Wright Jun 8 '12 at 19:04
    
Another solution to having cutouts in latex lists is given here tex.stackexchange.com/questions/53702/… –  David Carlisle Jun 8 '12 at 20:45

1 Answer 1

The cutwin package (and some \parshape gymnastics) can be used here:

\documentclass{article}
\usepackage{cutwin}
\usepackage{caption}
\usepackage{graphicx}
\usepackage{lipsum}

\begin{document}
\renewcommand\windowpagestuff{%
  \hspace*{25pt}\includegraphics[height=4cm]{ctanlion}
  \captionof{figure}{A test figure.}
}
\opencutleft

\begin{cutout}{2}{10pt}{0.5\linewidth}{12}
\begin{enumerate}
{%
\parshape 15 26pt \linewidth 26pt \linewidth 0.5\linewidth 0.5\linewidth
  0.5\linewidth 0.5\linewidth  0.5\linewidth 0.5\linewidth  0.5\linewidth 0.5\linewidth
  0.5\linewidth 0.5\linewidth   0.5\linewidth 0.5\linewidth   0.5\linewidth 0.5\linewidth 
  0.5\linewidth 0.5\linewidth   0.5\linewidth 0.5\linewidth   0.5\linewidth 0.5\linewidth
  0.5\linewidth 0.5\linewidth   0.5\linewidth 0.5\linewidth 26 pt \linewidth
\item \lipsum[1]
}%
\item \lipsum[2]
\item \lipsum[2]
\end{enumerate}
\end{cutout}

\end{document}

enter image description here

CTAN lion drawing by Duane Bibby.

share|improve this answer
1  
This should even work if you want to put the picture at the start of the numbering. I didn't try it with cutwin, but just an ordinary \parshape. –  Werner Jun 8 '12 at 19:05
    
@Werner you're probably right; I used cutwin to put the figure after some lines of the numbering; right now I have to leave, but I will do some tests later and post some code if no one else has done it. –  Gonzalo Medina Jun 8 '12 at 19:09
    
If this is a good, general solution to the problem, would it be possible to develop a package which makes it possible to do this as few of lines of code as wrapfig? Could wrapfig be modified to use this alternative approach when used in a list? –  ScottKu Jun 8 '12 at 20:01
    
Your minimal working example (cut win package) fails if one uses a different font, say \usepackage{palatino}. –  Vafa Khalighi Jun 9 '12 at 3:18
    
@VafaKhalighi yes, obviously it fails, because wrapping is related to font dimensions, that's why the packages like cutwin and wrapfig do exist, but in some cases, they cannot be used. The same problem can arise if the text contains inline math which changes the real baseline distance... –  tohecz Jun 9 '12 at 6:36

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.