# How to change the numbering for different figures?

Let's say I have two standard figures and two supplementary figures. If I change the name of figure using \renewcommand{\figurename} the figure counter will still count all figures continuously (i.e. Fig 1, Fig 2, Supp Fig 3, Supp Fig 4 – see code below). How can I reset the figure counter so it will count standard figures separately from supplementary figures?

\documentclass[]{article}
\usepackage[footnotesize]{caption}
\begin{document}
\begin{figure}[ht]
\caption{}
\end{figure}
\begin{figure}[ht]
\caption{}
\end{figure}
\begin{figure}[ht]
\renewcommand{\figurename}{Supplementary Figure}
\caption{}
\end{figure}
\begin{figure}[ht]
\renewcommand{\figurename}{Supplementary Figure}
\caption{}
\end{figure}
\end{document}

-

## 2 Answers

In preamble,

\usepackage{newfloat}
\DeclareFloatingEnvironment[name={Supplementary Figure}]{suppfigure}


In text,

\begin{suppfigure}
\caption{...}
\end{suppfigure}


If you use old versions of caption package, there is no newfloat package, then use caption package and \DeclareCaptionType command instead.

-

You can use \setcounter{figure}{0} to reset the figure counter. However, as noted by lockstep in the comments, this will cause the number of the next "normal" figure to be wrong, as demonstrated in the example below, which has two Figure 2.

Another option is to define a new float style with the float package.

\documentclass[]{article}
\usepackage{float}
\usepackage[footnotesize]{caption}

\newfloat{suppfig}{tbh}{losf}
\floatname{suppfig}{Supplementary Figure}
\begin{document}
\begin{figure}[ht]
\caption{}
\end{figure}
\begin{figure}[ht]
\caption{}
\end{figure}
\setcounter{figure}{0}
\begin{figure}[htb!]
\renewcommand{\figurename}{Supplementary Figure}
\caption{}
\end{figure}
\begin{figure}[htb!]
\caption{}
\end{figure}
\begin{suppfig}[htb!]
\caption{}
\end{suppfig}
\begin{suppfig}[hb!]
\caption{}
\end{suppfig}
\end{document}

-
Resetting the figure counter will cause wrong numbering of the next "normal" figure (unless one saves and restores the former value). If the OP's aim is to "count standard figures separately from supplementary figures", the correct way seems to be to define different float types, as Leo Liu already did in his answer. –  lockstep Dec 25 '11 at 17:43
@lockstep Of course, and I agree. I'll add a note about this in my answer. –  Torbjørn T. Dec 25 '11 at 17:47