what facilities are available depend on what document class you are using. some classes provide "super-sectioning" of a book into \frontmatter
(automatic roman page numbers), \mainmatter
(restarts page number at 1 and resets font to arabic), and \backmatter
(clears any "leftovers" from appendix
). \appendix
is often set up to reset the \chaptername
to "Appendix"; this flows automatically into the table of contents. look to see what's defined in the document class.
regarding blank pages without running heads, this is what the ams has done to make this happen automatically:
\let\cleardouble@page\cleardoublepage
\AtBeginDocument{%
\ifx\cleardouble@page\cleardoublepage
\def\cleardoublepage{\clearpage{\pagestyle{empty}\cleardouble@page}}
\fi
}
it can safely be used at the end of any chapter or other appropriate segment (like the toc) and will always result in the next "real" output starting on a right-hand page.
ams style doesn't use dots in the toc, so i'll leave that part of the question for someone else.
I believe the following code does most of what you're asking for. Be sure to use the macro \appsecnums
in each chapter at the start of the appendix area.
The major (but hopefully not disqualifying) limitation of this code is that you can't have subsections (or subsubsections) inside appendix-type sections because the numbering would be incorrect. (Specifically, you'd have an unwanted "Appendix" string prefixed to the sub(sub)section's number.) When cross-referencing an appendix section labelled, say, as \label{sec:newapp}
, be sure to write \ref{sec:newapp}
rather than Appendix~\ref{sec:newapp}
.
\documentclass{report}
\usepackage{tocloft} % the tocloft package lets you redefine the Table of Contents (ToC)
\renewcommand\cftchappresnum{Chapter } % prefix "Chapter " to chapter number in ToC
\cftsetindents{chapter}{0em}{8em} % set amount of indenting
\cftsetindents{section}{2em}{6em}
% Macros to redefine numbering of appendix sections (and to
% reset numbering when not in per-chapter area appendix)
\newcommand\normalsecnums{%
\renewcommand\thesection{\thechapter.\arabic{section}}}
\let\origchapter\chapter
\renewcommand{\chapter}[1]{\normalsecnums
\origchapter{#1}}
\newcommand\appsecnums{% % execute this command before entering appendix area
\setcounter{section}{0}
\renewcommand\thesection{\appendixname~\Alph{section}}}
\begin{document}
\tableofcontents
\chapter{First Chapter}
\section{Section Title}
\section{Section Title}
\appsecnums % switch to "appendix-style" numbering of sections
\section{Some additional stuff}
\section{Still more additional stuff}
\chapter{Another Chapter}
\section{Section Title}
\section{Section Title}
\appsecnums % switch to "appendix-style" numbering of sections
\section{Some additional stuff}
\section{Still more additional stuff}
\end{document}

Addendum. In the MWE above, to change the numbering style of the appendices from A
, B
, ... to <chapnum>.A
, <chapnum>.B
, ..., you'd need to modify the instruction
\renewcommand\thesection{\appendixname~\Alph{section}}}
as follows:
\renewcommand\thesection{\appendixname~\thechapter.\Alph{section}}}
You'll probably also need to increase the indent amount, in the third argument of cftsetindents
commands, by a bit, say by 0.75em:
\cftsetindents{chapter}{0em}{8.75em}
\cftsetindents{section}{2em}{6.75em}
Best Answer
You have to do the changes while reading the
.toc
file: this is an example of how to do it. The double\unexpanded
is because thetoc
entry is first written in the.aux
file and then in the.toc
, so we have to protect it twice. One could add several\protect
, but this is surely easier to write.The
\setupname
command might be integrated in\mainmatter
and in\appendix
, but this is left as an exercise. :)