[Tex/LaTex] How to wrap text around a figure inside an enumerate list structure

wrapfigure

My example is this:

\documentclass{amsart}
\usepackage{graphicx}
\usepackage{wrapfig}

\begin{document}
\begin{enumerate}
    \item \begin{enumerate}
        \begin{wrapfigure}{l}{0.5\textwidth}
        \centering
        \includegraphics[width=.98\linewidth]{lociplanarsetsedited.eps}
        \caption{A caption}
        \end{wrapfigure}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec erat libero, varius ut lacinia eget, fringilla sit amet nibh.
    \end{enumerate}
\end{enumerate}
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
\end{document}

The image I'm using comes from the graph of a planar set at https://sites.google.com/site/xtheunknown0/latex. I'm not sure how to get the eps up (but I converted the file first, of course).

So as you should be able to see, the image comes at the end of the document.
How do I put the graph to the right of the (1) and have the two sentences of Latin underneath the graph?

Best Answer

Environment wrapfigure does not work under enumerate environment.

My code:

\documentclass{amsart}
\usepackage{graphicx}

\usepackage{listings}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{listings}
\usepackage{wrapfig}
\usepackage[cc]{titlepic}
\usepackage{caption}

\begin{document}

\begin{wrapfigure}{r}{0.3\textwidth} %this figure will be at the right
    \centering
    \includegraphics[width=0.15\textwidth]{knuth.png}\\
    \caption{knuth}
\end{wrapfigure}
\noindent
 1. Lorem ipsum dolor sit amet, consectetur
                      adipiscing elit. 
             Donec erat libero, varius ut lacinia eget,
             fringilla sit amet nibh.\\
2. Lorem ipsum dolor sit amet, consectetur
                      adipiscing elit. 
             Donec erat libero, varius ut lacinia eget,
             fringilla sit amet nibh.\\
 \vspace{1cm}
  \noindent
 \begin{center}
   Lorem ipsum dolor sit amet, consectetur adipiscing elit.
\end{center}
\end{document}

Result: result1

The picture can be either set to right turn side or left turn side as you like by changing the wrapfigure option.

The answer has already appeared in TeX.

Related Question