# Change figure numbering for appendix

I want to the figure counting in my document when the appendix starts, and follow a different pattern than 1, 2, 3... Specifically, I want figures in the appendix to start with A.1 onward, instead of continuing on from the main document. How can I do this?

\documentclass[twoside]{article}

\usepackage{graphicx,dblfloatfix}

\usepackage{titlesec}% Allows customization of titles
\titleformat{\section}[block]{\large\scshape\centering{\Roman{section}.}}{}{1em}{} % Change the look of the section titles

\begin{document}

\section{Introduction}
\subsection{Problem description}
Blah blah
\begin{figure}[!htb]
\centering
\includegraphics{decon}
\caption{Call this figure 1.}
\label{fig1}
\end{figure}
\appendix
\section{Figures}

\begin{figure}[!htb]
\centering
\includegraphics{decon}
\caption{Call this figure A.1.}
\label{figa1}
\end{figure}

\begin{figure}[!htb]
\centering
\includegraphics{decon}
\caption{Call this figure A.2.}
\label{figa2}
\end{figure}

\end{document}

-

Redefine \thefigure when your appendices start, and set the figure counter to zero at the beginning of each appendix.

\documentclass{article}
\begin{document}
\begin{figure}
\centering\rule{1cm}{1cm}
\caption{This is a figure}
\end{figure}
\appendix
\renewcommand\thefigure{\thesection.\arabic{figure}}
\section{A nice appendix}
\setcounter{figure}{0}
\begin{figure}
\centering\rule{1cm}{1cm}
\caption{This is a figure in appendix A}
\end{figure}
\end{document}

-

You can use the chngcntr package which includes the command \counterwithin.

Using this as \counterwithin{figure}{section} changes the figure numbering from that point on so that the section number is included and resets the numbering of figures at the beginning each subsequent section. An example is:

\documentclass{article}

\usepackage{chngcntr}

\begin{document}

\section{Introduction}

\subsection{Problem description}

\begin{figure}[htp]
\centering Figure
\caption{Call this figure 1.}
\label{fig1}
\end{figure}

\appendix
\counterwithin{figure}{section}

\section{Figures}

\begin{figure}[htp]
\centering Figure
\caption{Call this figure A.1.}
\label{figa1}
\end{figure}

\begin{figure}[htp]
\centering Figure
\caption{Call this figure A.2.}
\label{figa2}
\end{figure}

\end{document}


-
To make this work for tables, you need to also put \counterwithin{table}{section}. –  ACD Nov 22 '13 at 3:06