8

I have created a table of contents page using \tableofcontents and I have enough chapters and sections that it fills an entire page and goes into another.

The problem is that since it takes a second page all of the page numbering is off by 1.

Is there a way that I can fix that?

2
  • 6
    Welcome to TeX.SX. On the first run the table of contents is not written; on the second run it is, but its appearance may offset the page numbers. On the third run all will be correct.
    – egreg
    Commented Dec 19, 2011 at 17:30
  • 2
    I tried ScribTeX and it seems that adding \usepackage{lastpage} forces the process to do the required runs of LaTeX when the ToC occupies more than one page. Maybe it's better to put the reference to ScribTeX in the question.
    – egreg
    Commented Dec 23, 2011 at 10:15

1 Answer 1

13

Creating a table of contents (ToC) needs at least two LaTeX runs: The first run to collect the data for the ToC and write it into an auxiliary file, the second run to actually typeset the ToC. In case the ToC itself takes more than one page, a third LaTeX run is needed (which will use the auxiliary data from the second run).

4
  • I have been using the website ScribTek (website) to generate my files. Does this mean to get this to work I will have to use something locally to get it to work correctly? (not opposed to it, just curious) Commented Dec 19, 2011 at 17:37
  • @JoshPennington: Sorry, I don't know anything about ScribTek and how it determines if another LaTeX run is needed.
    – lockstep
    Commented Dec 19, 2011 at 17:41
  • I am having this exact problem. My TOC is 6 pages long and the page numbering for all the sections is offset by exactly 6. I've tried running LaTeX two times and even three times, but it doesn't seem to make a difference. Any suggestions? Commented Jun 15, 2013 at 1:27
  • @Claudia: Does the ToC start on page 1 (say) and the first chapter on page 7?
    – Werner
    Commented Jun 15, 2013 at 1:52

You must log in to answer this question.

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