3

Consider this MWE.

\documentclass{memoir}
\begin{document}
\frontmatter
\tableofcontents
\chapter{Preface}
\mainmatter
\chapter{First Chapter}
\chapter{Second Chapter}
\chapter{Third Chapter}
\backmatter
\chapter{Index}
\end{document}

My book doesn't have sections, only chapters. I want to reduce the spacing between chapters in ToC and align the unnumbered chapter with the numbered one. How can I do this for memoir class? I have found several solution for KOMA-script, report, article, book, but none for memoir.

3

The memoir manual has a whole chapter on layout of the ToC (and otehr contents lists). In your case, changing the value of the length \cftbeforechapterskip can be used to set the vertical spacing. And playing with \cftsetindents and \cftchapterpresnum allows you to align the titles of numbered and unnumbered chapters. Complete example:

\documentclass{memoir}

% added to modify ToC layout
\setlength{\cftbeforechapterskip}{0pt} %reduces spacing between titles
\cftsetindents{chapter}{1.em}{0em}     %indent titles 1em, allow 0em for numbers
\renewcommand{\cftchapterpresnum}{\hspace{-1.em}}%so move the numbers to the left
% end addition

\begin{document}
\frontmatter
\tableofcontents

\chapter{Preface}
\mainmatter
\chapter{First Chapter}
\chapter{Second Chapter}
\chapter{Third Chapter}
\backmatter
\chapter{Index}
\end{document}
  • Tip: use -\cftchapterindent in the presnum line, then you don't have to write the value twice – daleif May 7 '18 at 12:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.