I am looking for a method to set the minimum number of pages for the TOC.
For example, with the MWE, chapter 1 starts on the 3rd page in first run, and the 14th page on second run. Knowing this I would like to get the first run to also start chapter 1 on the 14th page by inserting a sufficient number of blank pages for the TOC. In the second run, there should be 0 pages inserted (at least in this case since I reserved the correct number of pages).
Background:
This bug is causing me quite a bit of grief: "pgf Error: No shape named i-0 is known", but only upon 2nd run.
The problem seems to be related to
the number of pages used by the TOC changing between runs.
So was hoping that something like this can be used as a temporary fix until the bug in the intersections
library is fixed.
Code:
\def\NumberOfChapters{10}
\def\NumberOfSections{50}
\documentclass{book}
\usepackage{lipsum}
\usepackage{pgffor}
\begin{document}
\frontmatter
\pagenumbering{roman}
\tableofcontents
\pagenumbering{arabic}
\clearpage
\mainmatter
\foreach \x in {1,...,\NumberOfChapters}{
\chapter{Chapter \x}
\foreach \y in {1,...,\NumberOfSections}{
\section{Section \y}
\lipsum[1-7]
}
}
\end{document}
\foreach\x in {\value{page},...,14}{\vbox{}\newpage}
?\tableofcontents\cleardoublepage \foreach\x in {\value{page},...,14}{\vbox{}\newpage} \pagenumbering{arabic}
the chapters are set "in place." Note that using\pagenumbering
resets the page value to 1, so it should be issued after the "magic formula."