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
which shows the undefined control sequence is
\includegraphics
. This is because you don't haveBeware that
subfigure
has been deprecated several years ago and its successor issubfig
; the command\subfigure
should be changed into\subfloat
.Use
\centering
, not thecenter
environment.