1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Latex nubering of subfigures

  1. May 5, 2009 #1

    In my report, I want figures to be numbered within sections, so I put the following in the preamble of my document:
    Code (Text):
    This works great, except for when I am referencing subfigures. I have the following code:
    Code (Text):
        \caption{$\Phi_{N}(x,y)$ for $N=1,20,50$}
    Figure \ref{fig:fx} shows that ...
    This produces something like "Figure 2(a) shows that ..." instead of "Figure 4.2(a) shows that ...". I have worked around this by doing the following:
    Code (Text):
    Figure \ref{sec:comparison}.\ref{fig:fx} shows that ...
    Where sec:comparison is the label I have applied to the appropriate section.

    Is this the only way around this? Or am I doing something wrong?


  2. jcsd
  3. May 5, 2009 #2

    matt grime

    User Avatar
    Science Advisor
    Homework Helper

    What does altering the subfigure counter do? Something like

    Code (Text):

    I've never used that numberwithin command, instead I would have defined the figure counter afresh with a \newcounter declaration for subfigures (please don't ask me to work out what it should be on the fly - I googled it and found at least 3 different suggestions for syntax, none of which I can verify as working).
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook