Perhaps this is the simplest method: Using a wrapper
command that performs \chapter*{}
and adds the line to the ToC automatically.
\frontmatter\chapter{foo}\mainmatter
would be possible too, but this changes the pagenumbering as well, which is not desired, most likely.
I provide two variants, both having the same effect. I prefer the 2nd one with no explicit \addcontentsline
, however!
The 2nd variant uses a temporary change of the secnumdepth
coutner which controls whether a sectioning unit is numbered in display or not. Setting it to -1
will only leave \part
countered, restoring after the suprachapter
has been used will provide the usual behaviour.
\documentclass{book}
\usepackage{xparse}
\usepackage{hyperref}
\newcounter{oldsecnumdepth}
\NewDocumentCommand{\suprachapter}{som}{%
\IfBooleanTF{#1}{%
\chapter*{#1}%
}{%
\chapter*{#3}%
\IfValueTF{#2}{%
\addcontentsline{toc}{chapter}{#2}%
}{%
\addcontentsline{toc}{chapter}{#3}%
}%
}%
}
\NewDocumentCommand{\suprachapterother}{som}{%
\IfBooleanTF{#1}{%
\chapter*{#1}%
}{%
\setcounter{oldsecnumdepth}{\value{secnumdepth}}%
\setcounter{secnumdepth}{-1}%
\IfValueTF{#2}{%
\chapter[#2]{#3}%
}{%
\chapter{#3}%
}%
\setcounter{secnumdepth}{\value{oldsecnumdepth}}%
}%
}
\begin{document}
\tableofcontents
\part{Foo}
\suprachapter{Ice scream}
\chapter{Vanilla flavour}
\chapter{Albatross flavour}
\suprachapterother{PIE}
\chapter{Apple Pie}
\chapter{Black Forest Cherry Tarte}
\end{document}

\chapter*{ICE CREAM}
perhaps, slightly modified to get rid of the clearpage (if that is an issue?)