bookdown-crc icon indicating copy to clipboard operation
bookdown-crc copied to clipboard

Index entry page numbering is incorrect when TOC is long

Open turtlegraphics opened this issue 4 years ago • 0 comments

When the table of contents exceeds two pages (and therefore goes from 2 to 4 pages total), the page numbers and hyperlinks for index entries are off by two pages.

To reproduce this, clone this repo and then add enough section headings to grow the TOC. I put about 60 level-two headings into chapter 2 to accomplish this.

Then observe that the index entries for "bookdown" and "knitr" are incorrect by two pages - the same two pages that the TOC gained. The index entry for "FOO" is correct because the \mainmatter command restarts the page numbering. However, for a book without a frontmatter mainmatter split, the index page numbers are wrong for the entire book.

I can't tell if this is a problem with krantz.cls or with bookdown.

turtlegraphics avatar Jan 03 '21 06:01 turtlegraphics