[Tex/LaTex] Change page numbering of appendices to A.1…B.1

appendicesbibliographiespage-numberingtable of contents

I have 4 appendices (Syntax, Questionnaire, List of Abbreviations and the Bibliography). The page numbering is put to "Alph".

I would like to have just four letters A,B,C,D in my table of contents for each Appendix to appear (Syntax A, Questionnaire B, List of Abbreviations C and Bibliography D), even though almost every four of them has more than one page. So, I would like to have every follow-up page as A.1, A.2, respectively B.1, B.2 et cetera.

Can someone help me?

What I tried:

\appendix
\pagenumbering{Alph}
\renewcommand{\thesection}{B.\arabic{section}}
\input{./Appendices/Syntax}
\input{./Appendices/Questionnaire}

Best Answer

Assuming the class is book and that no material will follow the appendices, here's an idea.

Add to \appendix a \cleardoublepage to ensure you're in a fresh state; then the command will redefine \thepage to have the appendix letter in front of the number. We also redefine \chapter from that point on to reset the page counter to 1.

\documentclass{book}
\usepackage{etoolbox}
\usepackage{kantlipsum} % for dummy text

\preto\appendix{%
  \cleardoublepage
  \renewcommand{\thepage}{\thechapter.\arabic{page}}%
  \preto\chapter{\cleardoublepage\setcounter{page}{1}}%
}

\begin{document}

\mainmatter

\chapter{Chapter in main body}

\kant

\appendix

\chapter{Syntax}

\kant

\chapter{Questionnaire}

\kant

\chapter{List of Abbreviations}

\kant

\chapter{Bibliography}

\kant

\end{document}