Creating a new float (memoir)

I recently started using memoir. Previously I had a number of floats defined using float package-- attachment, code, and illustration in addition to default figure and table.

Now that I'm trying to define new floats in memoir way, I'm struggling a bit. I followed memoir documentation and defined illustration as below:

\newcommand{\illustrationname}{Illustration}
\newfloat[chapter]{illustration}{lol}{\illustrationname}


And I'm using it like this:

\begin{illustration}
\includegraphics[width=0.45\textwidth]{2027-original}
\illustrationname{caption goes here}
\label{ill:2027}
\end{illustration}


However, when I run pdflatex, I get the following error:

<use ./images/2027-original.png> [5 <./images/2027-original.png>] [6]
! Use of \pictur@ doesn't match its definition.
<argument> \includegraphics


So how can I make this illustration float to use \includegraphics?

-
You should use \caption{...}, not \illustrationname{...} for you illustration caption. Regardless, a minimal example using the graphicx package - note the x - works without problem. Are you perhaps using the graphics package? –  Werner Apr 12 '12 at 5:15
Thanks @Werner. Using \caption helped! –  Grnbeagle Apr 12 '12 at 5:38

Here's what worked for me:

In the preamble:

\newcommand{\illustrationname}{Illustration}
\newfloat[chapter]{illustration}{lol}{\illustrationname}


In the body:

\begin{illustration}
\centering
\includegraphics[width=0.45\textwidth]{2027-original}
\caption{caption goes here}
\label{ill:2027}
\end{illustration}

-
Is the above fragment complete and sufficient? Did you separately need to define a counter and an environment? I am trying to do the same thing as you and using section 10.1 of the memoir manual but am having a hard time! Thanks. –  chandra Dec 25 '12 at 10:31