\documentclass{article}
usepackage{xypic,wrapfig,enumitem}
\begin{document}
\begin{enumerate}
\item Let $X$ be an annulus surrounded by two concentric circles $C_1$ and $C_2$ and $C$ be any concentric circle lying completely in $X$. Show that the circle
$C$ is a strong deformation retract of $X$. Calculate $\pi_1(X)\cong \mb Z$
\begin{wrapfigure}{r}{0.2\textwidth}
\includegraphics[width=0.2\textwidth]{fig2.png}
\vspace{-.5cm}
\end{wrapfigure}
$[From the centre $O$ draw a half line in each direction. Each such line meets the circle $C$ in a unique point, $r(x)$(say). Let $r : X \rightarrow C$
be the mapping which maps all points of the half line to the corresponding point $r(x)$. Define $H : X \times I \rightarrow X$ by $H(x,t)=(1-t)x+tr(x)$.
Then $H$ is a strong deformation retraction.
$]$
\end{enumerate}
\end{document}
- 100,947
- 1,676
1 Answers
None of the figure wrapping packages for LaTeX (wrapfig, picins, floatflt) work within lists. Supposedly LaTeX3 will fix that, but so far I have not seen any solution. If you are willing to switch to ConTeXt, though, this sort of stuff seems to work in ConTeXt perfectly fine. To have a figure on the left side, with text wrapping around it, all you do is
\placefigure[left] {caption} {content of the figure}
and if you want the figure to be on the right of the text, you replace left with right. It works fine with lists, and only thing you have to watch for is placing figures near page boundaries, where they could stick out into the bottom margin and possibly out of the page. More about figure placement in ConTeXt can be found on ConTeXt garden.
Here is your example rewritten in ConTeXt:
\starttext
\startitemize[n]
\item Let $X$ be an annulus surrounded by two concentric circles $C_1$ and
$C_2$ and $C$ be any concentric circle lying completely in $X$. Show that
the circle $C$ is a strong deformation retract of $X$. Calculate
$\pi_1(X)\cong \mb Z$
\placefigure[right]{}{\externalfigure[fig2.png][width=0.2\textwidth]}
[From the centre $O$ draw a half line in each direction. Each such line
meets the circle $C$ in a unique point, $r(x)$(say). Let $r : X \rightarrow
C$ be the mapping which maps all points of the half line to the
corresponding point $r(x)$. Define $H : X \times I \rightarrow X$ by
$H(x,t)=(1-t)x+tr(x)$. Then $H$ is a strong deformation retraction.]
\stopitemize
\stoptext
Compile it by running
context file.tex
where file.tex is the name of your file.
I normally use LaTeX for most of my documents, but every time I need to write a document that wraps text around figures, I use ConTeXt for that.
- 62,301
- 19,242
-
This shows the following error 'Undefined control sequence\place figure' – Md Kutubuddin Sardar Mar 25 '13 at 03:36
-
wrapfigureand lists don't cooperate; for a possible work-around, see http://tex.stackexchange.com/q/59101/3954. – Gonzalo Medina Mar 25 '13 at 02:18\begin{enumerate}...\end{enumerate}environment. But the first page of thewrapfigdocumentation says: "You must not specify awrapfigurein any type of list environment or or immediately before or immediately after one. It is OK to follow a list if there is a blank line (\par) in between." So this will never work. – Alan Munn Mar 25 '13 at 02:19