TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question

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

share|improve this answer
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 Aug 21 '12 at 6:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.