[Tex/LaTex] Wrapfigure in an enumerate environment.

#enumeratewrapfigure

I want to use wrapfigure in the enumerate environment. For example,

\documentclass[11pt, a4paper]{article}
\usepackage{graphicx}
\usepackage{float}
\usepackage{wrapfig}

\begin{document}
\normalsize
{\bf Multiple Choice: }
\begin{enumerate}
    \item \begin{wrapfigure}{r}{4.5cm}
          \includegraphics[scale=0.5]{Exam1_Fig1.jpg}
          \end{wrapfigure}
          As shown in the figure. This rock is phaneritic and contains quartz, K-feldspar, and plagioclase in nearly equal amounts. What is it? \\
          (A) rhyolite \\
          (B) basalt \\
          (C) diorite \\
          (D) ash-flow tuff \\
          (E) granite \\
\end{enumerate}
\end{document}

However, the figure inserted is not wrapped by the text, but put in a strange position. How to fix the problem?

Thank you!

Best Answer

You cannot use wrapfigure in or near a list environment. If you look at the console output when you compile, you will see the warnings about this.

If you want wrapping here, you could fake it. For example:

\documentclass[11pt, a4paper]{article}
\usepackage[demo]{graphicx}
\usepackage{enumitem}

\begin{document}
  \normalsize
  {\bfseries Multiple Choice: }% do not use \bf in LaTeX it is deprecated 20+ years ago
  \begin{enumerate}
    \item As shown in the figure. This rock is phaneritic and contains quartz, K-feldspar, and plagioclase in nearly equal amounts. What is it?

    \begin{minipage}{.45\textwidth}
      \begin{enumerate}[label=(\Alph*), itemsep=0pt]% never number things manually!
        \item rhyolite
        \item basa
        \item diorite
        \item ash-flow tuff
        \item  granite
      \end{enumerate}
    \end{minipage}
    \begin{minipage}{.45\textwidth}
      \includegraphics[scale=0.5]{Exam1_Fig1.jpg}
    \end{minipage}
  \end{enumerate}
\end{document}

fake wrapping

Additional notes:

  • Never manually number things. Instead, use a customised list. In the above, I use enumitem to create such a list.
  • \bf ought not be used with LaTeX 2e documents. That is, it is deprecated 20+ years ago. Instead, use \bfseries (as above) or \textbf{}.
Related Question