8

When using the wrapfig environment followed by a list, the text of the first item of the list wraps around the figure. So, with the wrapfig that has a left placement, this text starts on the right of the figure and, when the figure ends, start from the beginning of the page.

But the text of the second item of the list has a big left margin from the page like the figure is still there (when it's not). How to make the following elements of the list starts from the left edge of the page?

The wrapfig documentation forbids to put the wrapfig environment "immediately" after or before a list environment, but here there's a paragraph and some text in between (so it's not immediately)

The same documentation even says that it's ok for wrapfig to follow a list environment if there's a newline (\par) between the two.

But nothing is said about wrapfig followed by a list, as this is the case (other than to forbid immediately followed by)

MWE:

\documentclass{article}
\usepackage{mwe} % for blindtext and example-image-a in example
\usepackage{wrapfig}
\usepackage{blindtext}
\begin{document}

\begin{wrapfigure}{l}{0.5\textwidth}
\centering
\includegraphics[width=.98\linewidth]{example-image-a}
\caption{A caption}
\end{wrapfigure}

List:
\begin{itemize}
    \item \blindtext
    \item \blindtext
\end{itemize}

\end{document}

Pic of the behaviour:

enter image description here

1
  • 1
    There is also the undocumented \WFclear command which can be use to terminate a confused wrapfig. Jan 3, 2016 at 16:36

1 Answer 1

7

You can solve your problem splitting the list in two and using the resume* option of the enumitem package (the second list uses the same parameters as the first list). A small vertical correction is managed by the before= key. Don't forget to insert a blank line between the two parts of the list.

\documentclass{article}
\usepackage{mwe} % for blindtext and example-image-a in example
\usepackage{wrapfig}
\usepackage{blindtext}
\usepackage{enumitem}
\begin{document}

\begin{wrapfigure}[12]{l}{0.5\textwidth}
  \centering
  \includegraphics[width=.98\linewidth]{example-image-a}
  \caption{A caption}
\end{wrapfigure}

List:
\begin{itemize}
  \item A first short item
  \item A second short item
  \item \blindtext
\end{itemize}

\begin{itemize}[resume, before = \vspace*{-\dimexpr\topsep+\partopsep\relax}]
  \item \blindtext
  \item \blindtext
\end{itemize}

\end{document} 

enter image description here

6
  • 1
    I think I understood now. My figure is at the end of the page, and the white space around it is very wide and gets into the following page too. So at the beginning of the following page there is still some space from the figure of the previous page. So I have to guess correctly the exact last item of the previous list for your solution to work. Isn't there a solution that doesn't require to guess the exact last item that gets wrapped aound? Also because it can change if new text is added, without having to declare a list for every item Jan 3, 2016 at 15:12
  • Not sure it works, but I had a solution for a similar problem, replacing the wrapfig package with the plain TeX insbox macro package. It works relatively easily in the neighbourhood of lists, but requires to insert the figure in a minipage if you want to have a caption. I could try to look if it works in your context.
    – Bernard
    Jan 3, 2016 at 16:02
  • I solved it with your method. Don't foresee to add text there anyway. If you could try, better. Thanks for the answer (I don't have enough reputation to vote you up) Jan 3, 2016 at 17:16
  • @Bernard please suggest from where should I download the insbox macro package, if possible, can you send the link for it, thanks...
    – MadyYuvi
    Feb 6, 2018 at 11:41
  • 1
    @MadyYuvi: Here is a link to insbox. However the simplest is to install it through the package manager of your distribution. Is it TeX Live, MacTeX or MiKTeX?
    – Bernard
    Feb 6, 2018 at 12:16

You must log in to answer this question.

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