yihui / bookdown-crc

A minimal example of using bookdown to write a book for Chapman & Hall/CRC
https://yihui.name/en/2018/08/bookdown-crc/
MIT License
72 stars 66 forks source link

Index entry page numbering is incorrect when TOC is long #6

Open turtlegraphics opened 3 years ago

turtlegraphics commented 3 years ago

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.