When I load the caption packages this way:
Code: Select all
\usepackage[font=small,labelfont={bf,sl},textfont=sl,labelsep=colon,justification=centering]{caption}
However, I would like to have equation numbers that go by section, so I load the caption package as above, except with the additional option figurewithin=section. The problem is that the subfigures end up being labeled 1.1a, 1.1b, 2.1c, 2.1d, instead of 1.1a, 1.1b, 2.1a, 2.1b. It seems the subequation counter is not starting over at the end of a section (as though the subfigure environment didn't get closed?).
Also, I noticed that adding another figure (without a subfigure) in the first section doesn't help, but that adding another figure (with a subfigure) in the first section fixes the problem. That is, it gives the correct numbering for the figure in the second section (i.e. 2.1a, 2.1b instead of 2.1c, 2.1d), and it gives the correct numbering for the added figure in the first section (i.e. 1.2a).
Does anyone know what's going on or how to fix it? What can I do to ensure that subfigure counters start over in each section, regardless of how many subfigures are in the previous section?
I have attached a .tex file that illustrates the problem. Make sure to compile twice to get labels right.
[EDIT] Oh, and here is the .jpg needed to compile the .tex file.