[Tex/LaTex] wrapfigure error

memoirwrapfigure

I'm using memoir (a beautiful documentclass that gets me in trouble too often)… and I'm trying to use wrapfigure.

This is what I use:

\documentclass[a4paper,oneside,12pt,openright,final,oldfontcommands]{memoir}
\usepackage{wrapfig}

\begin{document}    

\begin{wrapfigure}{./Images/13-SubdivisionRule}{o}{width=0.5\textwidth}
\caption[Shape Grammar Subdivision]{The subdivision of a surface by shape grammars for fabrication of the sheets \cite{shelden02}}
\label{SubdivisionSG}
\end{wrapfigure}

\end{document}

This is the error I get:

Package wrapfig Warning: wrapfigure used inside a conflicting environment on in
put line 129.

Best Answer

You are using wrapfigure in the wrong way; the syntax for this environment is

\begin{wrapfigure}[<number of lines>]{<placement>}[<overhang>]{<width>} 
<figure commands> 
\end{wrapfigure}

so, you you can use something like the following:

\documentclass[a4paper,oneside,12pt,openright,final,oldfontcommands]{memoir}
\usepackage[demo]{graphicx}
\usepackage{wrapfig}

\begin{document}    

\begin{wrapfigure}{o}{0.5\textwidth}
\includegraphics{./Images/13-SubdivisionRule}
\caption[Shape Grammar Subdivision]{The subdivision of a surface by shape grammars for fabrication of the sheets \cite{shelden02}}
\label{SubdivisionSG}
\end{wrapfigure}

\end{document}

If you are getting the warning

Package wrapfig Warning: wrapfigure used inside a conflicting environment on input line 129.

then most probably you are using wrapfigure inside a list-like environment (enumerate, or itemize, for example) and the use of the environment is not allowed inside lists.

Related Question