[Tex/LaTex] Changing the appendix section numbering back to A.1 when using scrbook with the appendix package

appendicesscrbooksectioningtable of contents

I have to submit my thesis next week and my professor just asked me to adapt to appendix numbering to "standard", i. e., A.1, A.2 etc.

I'm writing my thesis as a KOMA-Script scrbook. I'm using the appendix package, as that seemed to be the easiest way to make the appendix appear as a chapter in my thesis.

Currently, my ToC looks like this:

1 Chapter
1.1 Section

Appendices
1 Appendix section
List of Tables

But it has to look like this:

1 Chapter
1.1 Section

Appendices
A.1 Appendix section
A.2 List of Tables

The only clue I found in the appendix package documentation is the following quote:

By default, the subappendices are numbered like normal (sub)sections, except that the (sub)section number itself is typeset as an uppercase letter. This behaviour can be changed by redefining these \setthe... commands. For example, to just have a letter not prepended by the main division number, do:
\renewcommand{\setthesection}{\Alph{section}}

This sounds as if the appendices should already be numbered the way I need them to be. But they are not. The \renewcommand... does not affect the numbering at all.

How to force the List of Tables to be numbered accordingly is probably a second issue – I have no idea how to get it numbered at all 🙁

Here is my minimal working example:

\documentclass[listof=totoc, listof=leveldown]{scrbook}
\usepackage[toc,page,header]{appendix}
\newcommand{\mycap}[2]{\caption[#1]{\textbf{#1} #2}}
\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\chapter{Standard Chapter}
\section{Standard Section}

\begin{table}                                                                                                                           
  \mycap{Caption1.}{Rest of caption.}                                       
  \begin{tabular}{r r r}                                                                                                                                                            
Col1&Col2&Col3\\
Col1&Col2&Col3
  \end{tabular}                                             
\end{table}

\backmatter
\begin{appendices}
\renewcommand{\thetable}{A.\arabic{table}}
\setcounter{table}{0}

\section{Appendix Section}
 This is my appendix section.
\begin{table}
    \mycap{Caption2.}{Rest of caption.}                                     
  \begin{tabular}{r r r}                                                                                                                                                            
Col1&Col2&Col3\\
Col1&Col2&Col3
  \end{tabular} 
\end{table}

\listoftables
\end{appendices}
\end{document}

How do I fix the numbering?

Best Answer

You already found out that the list of tables gets numbered when choosing the documentclass option listof=totocnumbered. There are two more things that have to be done.

  1. Remove \backmatter or add the line

    \makeatletter\@mainmattertrue\makeatother

below \backmatter. The main task of \backmatter is to switch @mainmatter to false; as main consequence of this, section and subsection numbers will no longer be prefixed by chapter numbers. Keep \backmatter if you want it still to take care that the appendices open on a right-hand page if a certain option is set. Since you use \begin{appendices} from the appendix package, which takes care of this itself, \backmatter is redundant in your case.

  1. After \begin{appendices}, add the line

    \refstepcounter{chapter}

This is necessary since you have no \chapter command, hence the chapter counter remains set to 0, which cannot be displayed as letter. \refstepcounter not only sets the chapter number to 1 (displayed as A), but also resets all subordinate counters, so that sections, subsections, tables, figures etc are numbered within the appendix, starting from 1.

Regarding your sample code, you just have to replace the lines

\backmatter
\begin{appendices}
\renewcommand{\thetable}{A.\arabic{table}}
\setcounter{table}{0}

by

\begin{appendices}
\refstepcounter{chapter}
Related Question