I'm a heavy LaTeX user, but have very lite idea how the Tex programming is done. I'm writing a longer document and wanted to have figure numbers like that: chaper.section.figure_number e.g. Figure 4.3.10. After some goggeling i found this solution which works just fine:


,although I have no Idea why. When I'm using a subfigure with a label unfortunately I get references like that: chaper.figure_nuber e.g. 4.30(a). But what i want is: chapter.section.figure_number.(a,,b,c..) e.g. 4.2.10(a). I guess I have to define an additional command like above, but from the subfig documentation I can't say which and how...

I would appreciate any help

1 Answer 1


The following setup should to the job you're after. Note that I use the newer subcaption package instead of the older subfig package and that I make use of the \numberwithin command provided by the amsmath package.

\usepackage{amsmath,    % for \numberwithin and \eqref commands
            subcaption} % for subfigure environment
\usepackage[demo]{graphicx} % remove 'demo' option for real document

\chapter{First Chapter}
\section{New ideas}

\caption{First subfig} \label{fig:1a}
\hspace{\fill} % maximize horizontal separation of subfigs
\caption{First subfig} \label{fig:1b}
\caption{The first figure}

A display-style equation:

And here are cross-references to subfigures \ref{fig:1a} and \ref{fig:1b} 
as well as to equation~\eqref{eq:1}.

enter image description here

  • Thank's for your answer. I would rather continue to use the subfigure package since I already have a lot of them in my document... But if there is no other way i will switch to your solution...
    – Andre
    Commented Aug 21, 2012 at 6:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .