Graphics, Figures & TablesSubfloat Number not Resetting w/o Caption

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
EFaden
Posts: 24
Joined: Thu Jun 04, 2009 2:58 am

Subfloat Number not Resetting w/o Caption

Post by EFaden »

So I have a few figures, with subfloats in them. If I don't put a caption in the first one, then the next one doesn't reset the labels. Is there a way to get the numbering to reset without having a caption? Any ideas?

This works....

Code: Select all

\documentclass{article}
\usepackage{float,subfig}

\begin{document}
\begin{figure}[H]
	\subfloat[][T1]{
    	\begin{tabular}{ | c | c | c | }
			\hline
			Component & Retention & Area \% \\ \hline
    	\end{tabular}
	}
	\subfloat[][T1]{
    	\begin{tabular}{ | c | c | c | }
			\hline
			Component & Retention & Area \% \\ \hline
    	\end{tabular}
	}
   \caption{some more text}
\end{figure}

\begin{figure}[H]
	\subfloat[][T1]{
    	\begin{tabular}{ | c | c | c | }
			\hline
			Component & Retention & Area \% \\ \hline
    	\end{tabular}
	}
	\subfloat[][T1]{
    	\begin{tabular}{ | c | c | c | }
			\hline
			Component & Retention & Area \% \\ \hline
    	\end{tabular}
	}
   \caption{some text}
\end{figure}

\end{document}
This doesn't

Code: Select all

\documentclass{article}
\usepackage{float,subfig}

\begin{document}
\begin{figure}[H]
	\subfloat[][T1]{
    	\begin{tabular}{ | c | c | c | }
			\hline
			Component & Retention & Area \% \\ \hline
    	\end{tabular}
	}
	\subfloat[][T1]{
    	\begin{tabular}{ | c | c | c | }
			\hline
			Component & Retention & Area \% \\ \hline
    	\end{tabular}
	}
\end{figure}

\begin{figure}[H]
	\subfloat[][T1]{
    	\begin{tabular}{ | c | c | c | }
			\hline
			Component & Retention & Area \% \\ \hline
    	\end{tabular}
	}
	\subfloat[][T1]{
    	\begin{tabular}{ | c | c | c | }
			\hline
			Component & Retention & Area \% \\ \hline
    	\end{tabular}
	}
   \caption{some text}
\end{figure}

\end{document}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Subfloat Number not Resetting w/o Caption

Post by gmedina »

Hi,

you can reset the counter manually; add

Code: Select all

\setcounter{subfigure}{0}
right after the second \begin{figure}[H]
1,1,2,3,5,8,13,21,34,55,89,144,233,...
EFaden
Posts: 24
Joined: Thu Jun 04, 2009 2:58 am

Subfloat Number not Resetting w/o Caption

Post by EFaden »

gmedina wrote:Hi,

you can reset the counter manually; add

Code: Select all

\setcounter{subfigure}{0}
right after the second \begin{figure}[H]
Rock on. Thanks.
Post Reply