1

Possible Duplicate:
Numbers of figure references

I'm having some problem about subfigure numeration. The figures in my work are numbered inside the section using the line \numberwithin{figure}{section}, so they are like figure 2.1, 2.2, 2.3...

I tried to use the subfigure command and make reference to that figure, so the numeration should be 2.1(a), but it ignores the section number, showing just "figure 1(a)".

\documentclass{article}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{subfigure}
\numberwithin{figure}{section}
\begin{document}

\begin{figure}
\subfigure[subfigure a]{\includegraphics{image1} \label{image1}}
\subfigure[subfigure b]{\includegraphics{image2} \label{image2}}
\end{figure}

According to figure \ref{image1} we ...
\end{document}

Is that a way I could use this kind of numeration and the subfigure command?

If I remove the line \numberwithin{figure}{section} the numeration is fine

Eduardo
  • 277

1 Answers1

2

You can do this by redefining the command \thesubfigure and a couple of others. Take a look at this question for the details (read the whole thing). Incidentally, that answer recommends switching to a newer package that does the same thing.

Your question is basically a duplicate of that one. (You don't need to redefine \section and \subsection, as the sample code shows; that's all irrelevant to the question).

alexis
  • 7,961