[Tex/LaTex] Subfigure – Missing number

subfloats

I have a problem. I want to include 3 figures via subfigures. I want the first pic to be alone in the center and the second and third fig to be beneath. This is my code:

\begin{figure}
\centering
\begin{minipage}{0.8\textwidth}
    \centering
    \subfigure[First caption]
    {
        \includegraphics[width=0.39\textwidth]{82.pdf}
        \label{fig:first_sub}
    }
    \\
    \subfigure[Second caption]
    {
        \includegraphics[width=0.39\textwidth]{82.pdf}
        \label{fig:second_sub}
    }
    \subfigure[Third caption]
    {
        \includegraphics[width=0.39\textwidth]{82.pdf}
        \label{fig:third_sub}
    }
    \caption{Common figure caption.}
    \label{fig:sample_subfigures}
\end{minipage}
\end{figure}

The problem is that I get an Error: "! Missing number, treated as zero." After my first pic and I don't know why…
Maybe you guys can help me. I'd appreciate it.

Best Answer

It seems that you use obsolete package subfigure. Instead it try to use for example subfig which is replacement for it:

\documentclass{article}
\usepackage{graphicx}
\usepackage{subfig}

    \begin{document}
\begin{figure}[htb]
\centering
\begin{minipage}{0.8\textwidth}
    \centering
    \subfloat[First caption]
    {
        \includegraphics[width=0.39\textwidth]{example-image-a}
        \label{fig:first_sub}
    }
    \\
    \subfloat[Second caption]
    {
        \includegraphics[width=0.39\textwidth]{example-image-b}
        \label{fig:second_sub}
    }
    \subfloat[Third caption]
    {
        \includegraphics[width=0.39\textwidth]{example-image-c}
        \label{fig:third_sub}
    }
    \caption{Common figure caption.}
    \label{fig:sample_subfigures}
\end{minipage}
\end{figure}
    \end{document}

It gives:

enter image description here

Addendum: Another better possibility -- as said Torbjørn T. in his comment -- is to use package subcaption. Considering it above code become:

\documentclass{article}
\usepackage{graphicx}
\usepackage{subcaption}

    \begin{document}
\begin{figure}[htb]
\centering
\begin{minipage}{0.8\textwidth}
    \centering
\begin{subfigure}[b]{0.33\textwidth}\centering
        \includegraphics[width=0.9\textwidth]{example-image-a}
        \caption{First caption}
        \label{fig:first_sub}
\end{subfigure}
    \\
\begin{subfigure}[b]{0.33\textwidth}\centering
        \includegraphics[width=0.9\textwidth]{example-image-b}
        \caption{Second caption}
        \label{fig:second_sub}
\end{subfigure}
\begin{subfigure}[b]{0.33\textwidth}\centering
        \includegraphics[width=0.9\textwidth]{example-image-c}
        \caption{Third caption}
        \label{fig:third_sub}
\end{subfigure}
    \caption{Common figure caption.}
    \label{fig:sample_subfigures}
\end{minipage}
\end{figure}
    \end{document}

Obtained image is (almost) the same as before.