I'm using the subfig
package for subfigures and the float
package for forced float placement (H
). Using both these packages results in the subcaption not getting reset. The following example shows six figures from (a) to (f), whereas I'd expect them to be from (a) to (c), twice.
\documentclass[a4paper]{scrartcl}
\usepackage{graphicx}
\usepackage{float}
\usepackage{subfig}
\begin{document}
\begin{figure}[H] \centering
\subfloat[first subfig]{\includegraphics{img}}
\subfloat[second subfig]{\includegraphics{img}}
\subfloat[third subfig]{\includegraphics{img}}
\end{figure}
\begin{figure}[H] \centering
\subfloat[first subfig]{\includegraphics{img}}
\subfloat[second subfig]{\includegraphics{img}}
\subfloat[third subfig]{\includegraphics{img}}
\end{figure}
\end{document}
What I'm trying to achieve is subfigures exactly where I want them to be. Is there a way to solve this interference, or is there a better solution?
Best Answer
It's the
\caption
command that resets the subfigure numbers and you don't provide one.Actually,
\caption
performs\stepcounter{figure}
and it's this command that does the business. So, if you really don't want to have a global caption, issuebefore
\end{figure}
. This will reset thesubfloat
counter but won't affect thefigure
counter, as the net change is 0.