[Tex/LaTex] Subfigure: error “Missing number, treated as zero”

errorssubfloats

\begin{figure} \center
    \begin{subfigure}[b]
        \includegraphics[width=60mm]{a}
        \label{fig:a}
    \end{subfigure} %

    \begin{subfigure}[b]    
        \includegraphics[width=60mm]{b}
        \label{fig:b}    
    \end{subfigure} 
    \caption{my caption}
\end{figure}

I get an error

! Missing number, treated as zero.
<to be read again>
\let
           \includegraphics
                            [width=60mm]{a}

What's wrong?

Best Answer

This is how you should be using it.

\documentclass{article}
\usepackage{graphicx,subfigure}
\begin{document}
\begin{figure}
\centering     %%% not \center
\subfigure[Figure A]{\label{fig:a}\includegraphics[width=60mm]{example-image-a}}
\subfigure[Figure B]{\label{fig:b}\includegraphics[width=60mm]{example-image-b}}
\caption{my caption}
\end{figure}
\end{document}

enter image description here

Note: subfigure is outdated and new one is subfig which introduces subfloat command. You may consider using subfig instead of subfigure.