0

The following MWE produces a one-page document with the table of contents still on the first page.

\documentclass{memoir}
\begin{document}
Lorem ipsum

\tableofcontents
\end{document}

If I make \tableofcontents clear the page first explicitly by adding

\renewcommand{\tocheadstart}{\clearpage}

to the preamble, I get the ToC on page 2, but the entry for Contents lists it as on page 1.

Why?

(memoir 2021/06/16 v3.7p, pdfTeX, Version 3.141592653-2.6-1.40.23)

8
  • Never has, some people want a page break others don't, so memoir does not force it. I typically just add a \clearforchapter before it. And perhaps after it depending on the document
    – daleif
    Jul 16, 2021 at 6:15
  • Fair enough, I should have checked what \chapterheadstart does. I'm mainly concerned about the incorrect page number. I'll edit the question.
    – rzach
    Jul 16, 2021 at 13:02
  • Did you compile enough times?
    – daleif
    Jul 16, 2021 at 13:03
  • Yes, ..........
    – rzach
    Jul 16, 2021 at 13:12
  • 1
    That is because \tocheadstart is executed after \tableofcontents writes it self to the toc. This is done such that any hyperref to to (say from a book mark) jumps above the header, not below it. As mentioned, it is s lot easier to just use \clearforchapter, or use the \tableofcontents* which does not add it self to the toc.
    – daleif
    Jul 16, 2021 at 13:17

1 Answer 1

1

Use \addtodef instead to make \tableofcontents call \clearpage or \clearforchapter etc. before it does anything else.

\documentclass{memoir}
\addtodef{\tableofcontents}{\clearforchapter}{}
\begin{document}
\frontmatter
Lorem ipsum

\tableofcontents
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .