I came across this excellent TeX.SE answer, demonstrating the use of subappendices.
I have intentionally pasted the nice MWE developed by user Gonzalo Medina there as a starting point for my queries. This is so that there is parity with this approach and others using it may benefit. It is pasted as below (with minor modifications).
\documentclass{book}
\usepackage{appendix}
\usepackage{chngcntr}
\usepackage{etoolbox}
\usepackage{lipsum}
\AtBeginEnvironment{subappendices}{%
\chapter*{Appendix}
\addcontentsline{toc}{chapter}{Appendices}
\counterwithin{figure}{section}
\counterwithin{table}{section}
}
\begin{document}
\tableofcontents
\chapter{Test Chapter One}
\section{A regular section}
\section{Another regular section}
\begin{subappendices}
\section{Some title for an appendix}
\lipsum[4]
\section{Some title for an appendix}
\lipsum[4]
\end{subappendices}
\chapter{Test Chapter Two}
\section{A regular section}
\section{Another regular section}
\begin{subappendices}
\section{Some title for an appendix}
\lipsum[4]
\section{Some title for an appendix}
\lipsum[4]
\section{Some title for an appendix}
\lipsum[4]
\end{subappendices}
\end{document}
An image of the resulting ToC:
Questions
- How can I customize the header of each chapter appendix to include the chapter number, e.g. Appendices changed to Appendix - Chapter 1 for the Chapter One appendix?
- How can I change the indentation of the Appendices header titles in the TOC. Specifically, so that the Appendix TOC title is aligned with the respective chapter TOC title, not the Chapter TOC number? More specifically, in the TOC, I would like the text Appendices to be left aligned with text Test Chapter One (so the letter A from Appendices, aligns with the T from Test Chapter One), and then similarly for Test Chapter Two etc..
Any help on these would be appreciated.