0

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!

1
  • Welcome to TeX.SE! Your post was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question.
    – Werner
    Oct 26, 2016 at 0:49

1 Answer 1

0

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.

5
  • Thanks for your reply. Unfortunately, it seems that this didn't work when I put the code
    – lei
    Oct 23, 2016 at 20:15
  • Thanks for your reply. Unfortunately, it seems that this didn't work when I put the code "\renewcommand{\thefigure}{\thechapter.\arabic{figure}}' and '\renewcommand{\thetable}{\thechapter.\arabic{table}} ' at the top of the tables. I am not sure if I made myself clear. I was wondering if there is a way that I could move the tables within Chapter 3 to the end of my thesis (after the appendix) but keep the numbers as 3.1, 3.2, etc. Thanks again!
    – lei
    Oct 23, 2016 at 20:19
  • @lei: Yes. Move all the tables to your appendix where you want them and immediately before them, add \renewcommand{\thechapter}{3} as I mention towards the end of my answer. The original definitions of \thefigure and \thetable was just given for reference.
    – Werner
    Oct 23, 2016 at 20:25
  • Thanks! It worked this time. One more thing is that how can I restart the number of tables for each chapter, such as 3.1, 3.2 then 4.1, 4.2? Now it comes with 3.1,3.2, but 4.3, 4.4.....
    – lei
    Oct 23, 2016 at 20:43
  • I figured it out. It restarted the number of tables for each chapter by adding setcounter{table}{0}. Thank you for your help!
    – lei
    Oct 23, 2016 at 20:54

You must log in to answer this question.