Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
2  
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
1  
We'd like to keep answers separate from questions, so you should write a separate answer instead of editing your answer into the question. Self-answers are perfectly admissible, and a well-written answer may earn you additional reputation. –  lockstep Apr 12 '12 at 7:47
add comment

1 Answer

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}
share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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