10

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!

marked as duplicate by pluton, Gonzalo Medina, Sean Allred, Svend Tveskæg, user31729 Mar 9 '15 at 6:24

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • You can't. The documentation is very clear on this. It will not work in or near a list environment. – cfr Mar 9 '15 at 2:39
7

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{}.
  • Thank you! It works! And thanks for so many suggestions to my work~ – Wayne Tsai Mar 10 '15 at 11:00
  • 1
    @WayneTsai You're welcome - glad it helped ;). Sometimes faking is just so much more effective than trying to do impossible things! [Apparently I can't format lists in SE posts, though :(.] – cfr Mar 10 '15 at 13:46
  • Not sure why this just got down-voted. If there's a problem, it'd be nice to know what it might be. – cfr Feb 21 '18 at 23:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.