# Custom chapter types

I am typesetting a novel which is split into "books", which are further sectioned into "chapters" and "interludes". "Chapters" and "interludes" have independent counters (Chapter 1 is followed by Interlude A, then Chapter 2, Interlude B, Chapter 3, Chapter 4, Chapter 5, Interlude C, etc.) and are considered to be on the same level; neither is a subdivision of the other. In other words, the TOC should look like:

    Prologue ................................................ ##

Book I .................................................. ##

1. Chapter 1 ............................................ ##
Interlude A: Lorem ipsum ................................ ##
2. Chapter 2 ............................................ ##
Interlude B: Lorem ipsum ................................ ##
3. Chapter 3 ............................................ ##
4. Chapter 4 ............................................ ##
5. Chapter 5 ............................................ ##
Interlude C: Lorem ipsum ................................ ##
6. Chapter 6 ............................................ ##
⋮
16. Chapter 16 .......................................... ##
Interlude G: Lorem ipsum ................................ ##

Book II ................................................. ##

17. Chapter 17 .......................................... ##
⋮
Interlude H: Lorem ipsum ................................ ##
⋮


Each chapter/interlude should show the appropriate type in its header page, in the TOC and in the page header/footer. (Currently no interlude begins a book, but I don't want to rely on this.)

How do I accomplish this? I tried titlesec, but it fights me every step of the way. (Especially with page headers/footers.) I'm currently using the book class. I'd also prefer a solution that works with XeLaTeX.

• Welcome to TeX.sx. Can you add a Minum Working Example, so we know what class you are using and what results have you accomplished? – Guilherme Zanotelli Sep 16 '16 at 9:22
• No. The whole point of that question is that I have nothing that works and I want to start from scratch instead of getting other people stuck in the same dead end I am now. X-Y problem, people. – user114332 Sep 16 '16 at 9:31
• Ok then, could you add a draft of how you wish the table of Contents would look like? This sounds like a job for memoir class, but I'm not sure I got what it is that you want. – Guilherme Zanotelli Sep 16 '16 at 9:34
• Example TOC added. – user114332 Sep 16 '16 at 10:09
• I'm pretty sure you can achieve this with memoir, and without too much stress. Inside the book, do you want Interludes to look like Chapters, or Sections? – Brent.Longborough Sep 16 '16 at 10:10

Does something like this suit your needs? Of course you'd need to format it as you wish but I think the interlude problem is ok. The memoir class has a bunch of tricks to help you format best your document. Also, as you did not specify compiler I used XeLaTeX which enables font picking.

EDIT: using \refstepcounter instead of \stepcounter so that references can be properly made, as suggested by Johannes_B in the comments.

\documentclass{memoir}
\usepackage{fontspec,lipsum}
\setmainfont{Arial}
\newcounter{interludes}
\renewcommand{\theinterludes}{\Alph{interludes}}
\newcommand{\interlude}[1]{\refstepcounter{interludes}
\chapter*{#1}
}

\begin{document}
\tableofcontents*

\chapter*[Prologe]{Prologe}
\lipsum[1-3]

\book{The first book}
\chapter{The first chapter}
\lipsum[4-9]

\interlude{The interlude A}
\lipsum[4-9]

\end{document}

• On reflection, definitely better than my answer. – Brent.Longborough Sep 16 '16 at 11:56
• It's pretty much what I ended up doing. Except that I wrote \chapnamefont Interlude \theinterlude \afterchapternum in the definition for \interlude. – user114332 Sep 16 '16 at 12:10
• Maybe \refstepcounter is better? – Johannes_B Sep 18 '16 at 7:13
• @Johannes_B Most definetly, so that cross references can made properly. I didn't know that command, thank's a lot! I edited the answer. – Guilherme Zanotelli Sep 18 '16 at 9:17

A simple code to obtain what you want with titlesec, tocloft and appendix, which runs fine if you don't have appendices: it consists in using the appendices environment with the toctitle option, after we have changes \appendixname to ‘Interlude’:

\documentclass{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{garamondx}
\usepackage{geometry, lipsum, etoolbox}

\usepackage[english]{babel}
\usepackage[newparttoc,explicit, clearempty]{titlesec}%
\usepackage[titles]{tocloft}
\renewcommand{\cftpartpresnum}{BOOK\enspace}
\renewcommand{\cftchapaftersnum}{.}
\renewcommand\cftchapdotsep{\cftdotsep}

\titleformat{\part}[display]{\bfseries\filcenter \def\partname{Book}}{\Huge\MakeUppercase{\partname}\enspace\thepart}{20pt}{\Huge #1}[\thispagestyle{empty}]%

\titleformat{\chapter}[display]{\filcenter\bfseries}{\LARGE\MakeUppercase{\chaptername}~\thechapter}%
{1\baselineskip}{\huge#1}%
\titleformat{name=\chapter, numberless}[block]{\filcenter\bfseries}{}%

\usepackage[titletoc]{appendix} %
\AtBeginEnvironment{appendices}{\def\chaptername\appendixname}
\AtEndEnvironment{appendices}{\def\chaptername\oldchaptername}
\newenvironment{interludes}{%
\def\chaptername{Interlude}\def\appendixname{Interlude}\appendices}%
{\endappendices}

\makeatletter\renewcommand\tableofcontents{%
\chapter*{\contentsname}%
\@starttoc{toc}%
}
\makeatother

\begin{document}

\tableofcontents

\chapter*{Prologue}
\lipsum[1]
\part{}
\chapter{Chapter the First}
\lipsum

\chapter{Chapter the Second}
\lipsum

\chapter{Chapter the Third}
\lipsum
\begin{interludes}
\chapter{A First Interlude}
\lipsum
\chapter{A Second Interlude}
\lipsum
\end{interludes}
\chapter{Chapter the Sixth}
\lipsum

\part{}

\chapter{Chapter the Seventh}
\lipsum
\begin{interludes}
\chapter{A Third Interlude}
\lipsum
\end{interludes}

\end{document}


This is similar to Guilherme Santos' answer. I managed to post it as an answer to a different question! So I accept not being in first place, but here it is anyway.

Here's a preliminary solution that is about as simple as I could make it.

Basically it subverts memoir's \chapter and \book commands, replacing them with \mychapter and \mybook, and adds an \interlude command. I have assumed that for all three you want additional text besides just the (eg) 'Chapter 1', and I haven't done anything beyond the default memoir chapter style.

% !TEX TS-program = xelatex
\documentclass{memoir}
\newcounter{interlude}
\renewcommand{\theinterlude}{\Alph{interlude}}
\setcounter{interlude}{0}
\newcommand{\interlude}[1]{%
\chapter{Interlude \theinterlude: #1}
}
\newcommand{\mybook}[1]{%
\book{Book \thebook: #1}
}
\newcommand{\mychapter}[1]{%
\chapter{Chapter \thechapter: #1}
}
\chapterstyle{default}
\renewcommand{\printchaptername}{}
\renewcommand{\printchapternum}{}
\renewcommand{\afterchapternum}{}
\renewcommand{\chapternumberline}[1]{}
\renewcommand{\booknumberline}[1]{}
\begin{document}
\frontmatter
\tableofcontents*
\mainmatter
\mybook{To Begin at the Beginning}
\mychapter{Starting}
\interlude{First Interlude}
\interlude{Second Interlude}
\mychapter{Continuing}
\interlude{Another Interlude}
\mychapter{Almost in the Middle}
\interlude{Another Interlude}
\interlude{Another Interlude}
\mybook{To End at the End}
\mychapter{Nearly There}
\interlude{Another Interlude}
\interlude{Another Interlude}
\mychapter{Getting Close}
\interlude{Another Interlude}
\mychapter{At Last!}
\interlude{Another Interlude}
\interlude{Another Interlude}
\end{document}


Here's part of the TOC:

Clearly you may want to tweak the typography further; I suggest you explore the variety of memoir` chapter styles that are available, and if you need further help, make a new question.

• Guilherme Santos' answer is better – Brent.Longborough Sep 16 '16 at 11:56
• Thank you but I wouldn't say better, just simpler! :P – Guilherme Zanotelli Sep 16 '16 at 11:58
• More complete, I think. And I understood "Chapter 1" etc to be automatically generated. – Brent.Longborough Sep 16 '16 at 12:01
• Yeah I had this same line of thought, but since the OP wasn't specific about that I took my University Tutor's advice "If there is a simple way, take it...". – Guilherme Zanotelli Sep 16 '16 at 12:07