# Resume figure numbering after appendix

I'm preparing my thesis that consists of 11 chapters followed by an appendix, and finally yet another chapter (i.e., Dutch summary). In the last chapter (Dutch summary) I have a couple of figures and want to resume the figure numbering (e.g., the first figure of the Dutch summary chapter should be numbered with 12.1). Here is code to illustrate the problem:

\documentclass[11pt,twoside,openright]{memoir}

\begin{document}

\begin{KeepFromToc}
\tableofcontents \cleardoublepage
\end{KeepFromToc}

\chapter{Introduction}
This is chapter 1.

\begin{figure}
\caption{Body figure.}
\label{bodyfigure1}
\end{figure}

\appendix
\part*{Appendices}

\chapter{Appendix A1}
This is A1.

\begin{figure}
\caption{Body figure.}
\label{bodyfigure2}
\end{figure}

\backmatter

\chapter{Dutch Summary}
This is chapter 2.

\begin{figure}
\caption{Body figure.}
\label{bodyfigure3}
\end{figure}

\end{document}


When you compile this, you see that the first figure in Chapter 1 is correctly numbered with "Figure 1.1", however, the figure in Dutch summary chapter is numbered with "Figure 1", but it should read "Figure 2.1". Any ideas on how to fix this issue are very appreciated!

• You have asked some questions now, each of them as answers. Please consider to accept the answers in order to appreciate the helping work done by users here – user31729 Jan 28 '17 at 12:01

Here is a version with xassoccnt and its \BackupCountersGroup and \RestoreBackupCounterGroup features, storing the counter values of a specified number of counters and reinject them later on.

\documentclass[11pt,twoside,openright]{memoir}

\usepackage{xassoccnt}

\DeclareBackupCountersGroupName{dutchchapter}

\makeatletter
\newcommand{\StoreCounterFormats}{%
\let\latex@@thechapter\thechapter
\let\latex@@thefigure\thefigure
\let\latex@@thetable\thetable
}

\newcommand{\ContinueOldCounting}[2]{%
\RestoreBackupCounterGroup[backup-id=#1]{#2}%
\refstepcounter{chapter}%
\let\thechapter\latex@@thechapter
\let\thefigure\latex@@thefigure
\let\thetable\latex@@thetable
}
\makeatother

\AtBeginDocument{%
\StoreCounterFormats%
}

\begin{document}

\begin{KeepFromToc}
\tableofcontents \cleardoublepage
\end{KeepFromToc}

\chapter{Introduction}
This is chapter 1.

\begin{figure}
\caption{Body figure.}
\label{bodyfigure1}
\end{figure}

%Code to produce some dummy chapters
\makeatletter
\newcount\foocnt
\foocnt\c@chapter
\loop\unless\ifnum\foocnt=11
\chapter{Dummy chapter \the\foocnt}
\repeat
\makeatother
%End of dummy chapters production

% Make a backup of the state!
\BackupCounterGroup[backup-id=beforeappendices]{dutchchapter}

\appendix
\part*{Appendices}

\chapter{Appendix A1}
This is A1.

\begin{figure}
\caption{Body figure.}
\label{bodyfigure2}
\end{figure}

\backmatter

% Restore the old state
\ContinueOldCounting{beforeappendices}{dutchchapter}
\chapter{Dutch Summary}
This is chapter \thechapter

\begin{figure}
\caption{Body figure.}
\label{bodyfigure3}
\end{figure}

\end{document}


I am thinking about adding a possibibility of storing the \the.... macros in xassoccnt in one of the upcoming releases.

Here is a quick fix.

\chapter{Dutch Summary}
\setcounter{chapter}{11}
\refstepcounter{chapter}
\renewcommand\thechapter{\arabic{chapter}}
\renewcommand\thefigure{\thechapter.\arabic{figure}} % for figures
\renewcommand\thetable{\thechapter.\arabic{table}} % for tables

• Thanks! To clarify, I indeed want to have an unnumbered chapter, but figures referring to chapter 12 (chapter 2 was just used for illustrative purposes). And actually tables should also refer to chapter 12! – Helen Steingröver Jan 28 '17 at 10:10
• @HelenSteingröver I've added the fix for tables. – gernot Jan 28 '17 at 10:54
• Thanks for adding the fix for tables. It's almost perfect, the only issue is that figure and table numbering now starts with 9 (i.e., Figure 9.1). Probably because I have eight chapters in the appendix that precede the last unnumbered chapter "Dutch summary"!? Is there a way to make the figure and table numbering start with 12? – Helen Steingröver Jan 28 '17 at 11:52
• @HelenSteingröver I've added a line to adjust the chapter number. – gernot Jan 31 '17 at 9:42