6

I'm trying to match my supervisor's requirements for the appendix formatting. I'm using the scrbook- and appendix-package. Right now my chapters are numbered by letters A,B,C and the sections then by A.1, A.2, etc. I want it to be A1, A2, A3 for chapters and sections should be A1.1, A1.2, etc.

I saw many ways to change the chapter's formatting but I never saw the one I'd like to have. Are there any hints how to get there?

Cheers! Julian

Julian
  • 87

2 Answers2

6

You can do it by re-defining the \thechapter after appendix:

\renewcommand{\thechapter}{A\arabic{chapter}}

but then in toc, the spaces get messed up. To correct this, load tocloft and and adjust the spaces:

\setlength{\cftchapnumwidth}{2em}
\cftsetindents{section}{2em}{2.4em}
\cftsetindents{subsection}{4.4em}{3.2em}

Code:

\documentclass{book}
\usepackage{tocloft}
\setlength{\cftchapnumwidth}{2em}
\cftsetindents{section}{2em}{2.4em}
\cftsetindents{subsection}{4.4em}{3.2em}
\begin{document}
  \tableofcontents
  \chapter{Some chapter}
  \section{Asection}
  \appendix
  \renewcommand{\thechapter}{A\arabic{chapter}}
  \chapter{Some appendix}
  \section{section in appendix}
  \chapter{Some appendix again}
  \section{section in appendix again}
  \section{section in appendix again}
  \subsection{sub section in appendix again}
\end{document}

enter image description here

enter image description here

4

This can be achieved by using

\renewcommand{\thechapter}{A\arabic{chapter} in the appendices environment.

Since the counter output for section is normally based on \thechapter.\arabic{section} etc., the new definition for \thechapter will be used there too.

\documentclass{scrbook}

\usepackage{appendix}

\usepackage{hyperref}

\usepackage{blindtext}
\begin{document}
\tableofcontents
\blinddocument

\begin{appendices}
\renewcommand{\thechapter}{A\arabic{chapter}}

\chapter{First appendix chapter}

\section{First}
\section{Two}


\chapter{Second appendix chapter}

\section{First}
\section{Two}

\end{appendices}


\end{document}

enter image description here