[OS X TeX] Memoir figure problem

Alan Munn amunn at msu.edu
Sun Mar 1 17:10:12 EST 2009


At 11:26 AM -0800 3/1/09, David Arnold wrote:
>All,
>
>I am trying an example from memman.pdf using the memoir class.
>
>\documentclass{memoir}
>
>\begin{document}
>
>\begin{figure}
>\centering
>\begin{minipage}{0.45\textwidth}
>Hello
>\subcaption{Bar chart.}
>\end{minipage}\hfill
>\begin{minipage}{0.45\textwidth}
>Hello
>\subcaption{Bar chart.}
>\end{minipage}
>\caption{my caption\label{fig:BarAndLinePlot}
>\end{figure}
>
>\end{verbatim}
>
>\end{document}
>
>I am getting this error:
>
>! LaTeX Error: No counter 'subfigure' defined.
>
>See the LaTeX manual or LaTeX Companion for explanation.
>Type  H <return>  for immediate help.

To use subfloats in memoir you need to declare them with 
\newsubfloat{<floatname>}.  (Plus, your code has a few other 
unrelated errors: a stray \end{verbatim} command and a missing brace 
in the caption line.)

Here's a fixed version that works.  -Alan


\documentclass{memoir}
\newsubfloat{figure}
\begin{document}

\begin{figure}
\centering
\begin{minipage}{0.45\textwidth}
Hello
\subcaption{Bar chart.}
\end{minipage}\hfill
\begin{minipage}{0.45\textwidth}
Hello
\subcaption{Bar chart.}
\end{minipage}
\caption{my caption\label{fig:BarAndLinePlot}}
\end{figure}


\end{document}
-- 
Alan Munn						amunn at msu.edu
Department of Linguistics
and Germanic, Slavic, Asian and African Languages		Tel. 
	517-355-7491
Michigan State University, East Lansing MI 48824 USA	Fax	517-432-2736



More information about the MacOSX-TeX mailing list