[Tex/LaTex] How to change the numbering for different figures

floatsnumbering

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}

Best Answer

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.