GeneralSubfigure and labeling

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
sarox
Posts: 2
Joined: Wed May 02, 2007 9:07 am

Subfigure and labeling

Post by sarox »

Hi All,

I have some issue with the subfigure packag and the labeling.
The code hereafter looks fine for me, anyhow I got 4 errors: "Undefined control sequence".

If I remove the 2 label commands inside the subfigure (\label{fig:SelezionaAsl} and \label{fig:SelezionaRag}), everything works fine.

Could you please explain me which is the issue?

Thanks a lot,
Rosario

Code: Select all

\documentclass [11pt ,a4paper, twoside]{article}
\usepackage[latin1 ]{inputenc} 

\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{epsfig}
\usepackage{amsmath}
\usepackage{array}
\usepackage{url}
\usepackage[lofdepth,lotdepth]{subfig}

%\usepackage{hyperref}

\usepackage{indentfirst}

\usepackage [italian]{ babel }

\usepackage[big,binding=.6cm]{layaureo}

\pagestyle{fancy}
\graphicspath{{./img/}}



\lhead{Stampe parametriche}
\rhead{\today}

\title{Stampe}
\author{Rosario\thanks{rosario.xxx@xxx.it}}

\begin{document}
\maketitle

\begin{figure}[htbp]
	\begin{center}
		\subfigure[Prima si stampa.]	{
			\label{fig:SelezionaAsl}
			\includegraphics[width=0.45\textwidth]{SelezioneAsl}			
		} 
		\hspace{0.3cm}
		\subfigure[Poi si stampa.] {
			\label{fig:SelezionaRag} 
			\includegraphics[width=0.45\textwidth]{SelezioneRag}
		}
		\caption{Selezione dei campi.}
		\label{fig:SelezionaCampi}
	\end{center}
\end{figure}

\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Subfigure and labeling

Post by localghost »

You have to decide whether to use the subfig package or the subfigure package. The first is the preferable one because the second is obsolete. The better solution would be to use the subcaption package that comes with caption. Refer to the according documentations to get things work.


Best regards
Thorsten¹
Post Reply