[Tex/LaTex] undefined control sequence \label

subfloats

I am trying to run the following script

\documentclass[•]{article}
\usepackage{subfigure}

\begin{document}
\begin{figure}[htp]
  \begin{center}
    \subfigure[Original image]{\label{fig:edge-a}\includegraphics[scale=0.75]{1}}
    \subfigure[After Laplace edge detection]{\label{fig:edge-b}\includegraphics[scale=0.75]{3}} \\
    \subfigure[After Sobel edge detection]{\label{fig:edge-c}\includegraphics[scale=0.75]{2}}
  \end{center}
  \caption{Various edge detection algorithms}
  \label{fig:edge}
\end{figure}
\end{document}

The basis for this script is this link where the author explains how to place several figures with local and global captions for each figure and the entire figure set, respectively. The only difference is that I am using my own images and my own preamble (the link does not offer one).

When I run it I get the following error:

! Undefined control sequence. \label
{fig:edge-a}\includegraphics[scale=0.75]{1}
…ig:edge-a}\includegraphics[scale=0.75]{1}}

Why does this occur? Isn't the \label control sequence independent from any usepackages? How can I solve this problem?

Best Answer

The error you get is

! Undefined control sequence.
<argument> \label {fig:edge-a}\includegraphics 
                                               [scale=0.75]{1}
l.7 ...fig:edge-a}\includegraphics[scale=0.75]{1}}

which shows the undefined control sequence is \includegraphics. This is because you don't have

\usepackage{graphicx}

Beware that subfigure has been deprecated several years ago and its successor is subfig; the command \subfigure should be changed into \subfloat.

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

\begin{document}

\begin{figure}[htp]
  \centering
    \subfloat[Original image]{\label{fig:edge-a}\includegraphics[scale=0.75]{1}}
    \subfloat[After Laplace edge detection]{\label{fig:edge-b}\includegraphics[scale=0.75]{3}} \\
    \subfloat[After Sobel edge detection]{\label{fig:edge-c}\includegraphics[scale=0.75]{2}}
  \caption{Various edge detection algorithms}
  \label{fig:edge}
\end{figure}

\end{document}

Use \centering, not the center environment.