lei lei - 1 month ago 13
LaTeX Question

Change the number of figures or tables in the appendix of my thesis in latex

I am working on my thesis in Latex with "book" documentclass. There are a couple of chapters in the thesis with several tables or figures. When I put all those tables or figures after the Appendix, the numbers of them changed, e.g. from "3.1" (First table in Chapter 3) to "A1".
I was wondering if someone could help me keep the format of numbers of tables or figures as "3.1", "3.2", etc. By the way, I used "\appendix" for the appendix section. Thank you!

Answer

By default, figures and table assume a <chapter>.<float> numbering scheme under book. More formally,

\renewcommand{\thefigure}{\thechapter.\arabic{figure}}
\renewcommand{\thetable}{\thechapter.\arabic{table}}

(with some conditional that is not important here). And, with an issue of \appendix, \thechapter is updated to \Alph{chapter}. For your purposes it seems to suffice to hard-code \thechapter:

enter image description here

\documentclass{book}

\begin{document}

\listoftables

\chapter{A chapter}

\begin{table}\caption{A table}\end{table}
\begin{table}\caption{A table}\end{table}
\begin{table}\caption{A table}\end{table}

\appendix
\chapter{An appendix}

\begin{table}\caption{A table}\end{table}
\begin{table}\caption{A table}\end{table}
\begin{table}\caption{A table}\end{table}

\renewcommand{\thechapter}{3}%
\begin{table}\caption{A table}\end{table}
\begin{table}\caption{A table}\end{table}
\begin{table}\caption{A table}\end{table}

\end{document}

The assumption is, of course, that you don't have any figures or tables in Chapter 3, otherwise this would definitely confuse the reader. Moreover, if you are using hyperref, such redefinitions could cause problems with hyperlinking if the figure number is not unique.