Some users would like to be able to add appendices not only to the document, but also to individual chapters. In addition, the chapter appendices in the table of contents should be introduced by a line "Chapter Appendix" without a number or page number. In the individual appendices, the sections should be numbered with the number of the chapter followed by a letter. There should be no period between the chapter number and the letter.
Note: The request actually contradicts the meaning of the word "appendix", as this is classically something that is attached after the end of the actual document. Chapter appendices, on the other hand, are in the middle of the document and are therefore interjections rather than appendices in the classic sense.
A new chapterappendix
environment can be defined for implementation:
\newenvironment{chapterappendix}{%
\par% end the current paragraph
\setcounter{section}{0}% reset the section counter
\renewcommand*{\thesection}{\thechapter\Alph{section}}% or \alph instead of \Alph for lower case letters
\section*{Chapter Appendix}%
\addtocontents{\UseName{ext@toc}}{% ToC mark
\hskip \UseName{scr@tso@section@indent}\textbf{Chapter Appendix}\par}%
% If you want you can also extend the section number in the running head:
\renewcommand*{\sectionmarkformat}{\appendixname~\thesection\autodot\enskip}%
}{}
In contrast to the \appendix
statement, this environment does not redefine anything globally. Only the section counter is globally reset to 0. However, this is not a problem because after \end{chapterappendix}
the current chapter should not be continued anyway, but another \chapter{...}
may be expected. This then also resets the counter.
As a complete example we would then have:
\documentclass{scrbook}
\usepackage[english]{babel}
\usepackage{blindtext}
\newenvironment{chapterappendix}{%
\par% end the current paragraph
\setcounter{section}{0}% reset the section counter
\renewcommand*{\thesection}{\thechapter\Alph{section}}% or \alph instead of \Alph for lower case letters
\section*{Chapter Appendix}%
\addtocontents{\UseName{ext@toc}}{% ToC mark
\hskip \UseName{scr@tso@section@indent}\textbf{Chapter Appendix}\par}%
% If you want you can also extend the section number in the running head:
\renewcommand*{\sectionmarkformat}{\appendixname~\thesection\autodot\enskip}%
}{}
\begin{document}
\tableofcontents
\blinddocument
\begin{chapterappendix}
\section{Section of the Chapter Appendix}
\blindtext
\section{Section of the Chapter Appendix}
\blindtext
\section{Section of the Chapter Appendix}
\blindtext
\section{Section of the Chapter Appendix}
\blindtext
\end{chapterappendix}
\blinddocument
\begin{chapterappendix}
\section{Section of the Chapter Appendix}
\blindtext
\section{Section of the Chapter Appendix}
\blindtext
\section{Section of the Chapter Appendix}
\blindtext
\section{Section of the Chapter Appendix}
\blindtext
\end{chapterappendix}
\end{document}