[GH-ISSUE #1812] [Bug] Duplicate chapter pages and wrong page numbers #18071

Closed
opened 2026-05-28 21:49:58 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @obsessor-ak1 on GitHub (May 28, 2026).
Original GitHub issue: https://github.com/harvard-edge/cs249r_book/issues/1812

Area

Book — Volume II

Location

Table of Contents and Related pages

Description

In the table of contents as well as in the corresponding page, there is a repetition of chapter "Chapter 3: Network Fabrics" and then "Chapter 4: Network Fabrics"
Image
The corresponding "Chapter 3: Network Fabrics" page is blank:
Image
Also, page numbers are restarting (from 3) from "Part 3: Deployment at Scale":
Image
And this is also visible in the actual text, with a redundant "Part 3: Deployment at Scale" page:
Image
Redundant page:
Image

Expected Behavior

The following behaviors are expected in true pdf:

  • The on Network Fabrics should start from Chapter 3 and not 4 and hence there should be 17 chapters in total.
  • The page numbers from chapter 10 should start from somewhere around 435 or 440 instead of 3
  • The redundant page for Part 3: Deployment at Scale should not be there.

Environment (TinyTorch bugs only)

No response

Originally created by @obsessor-ak1 on GitHub (May 28, 2026). Original GitHub issue: https://github.com/harvard-edge/cs249r_book/issues/1812 ### Area Book — Volume II ### Location Table of Contents and Related pages ### Description In the table of contents as well as in the corresponding page, there is a repetition of chapter "Chapter 3: Network Fabrics" and then "Chapter 4: Network Fabrics" <img width="1918" height="945" alt="Image" src="https://github.com/user-attachments/assets/2d7eb6ac-aedc-4661-8efc-30491f19e892" /> The corresponding "Chapter 3: Network Fabrics" page is blank: <img width="1919" height="948" alt="Image" src="https://github.com/user-attachments/assets/eb5702e7-1be2-4882-a46b-fb9956c5be24" /> Also, page numbers are restarting (from 3) from "Part 3: Deployment at Scale": <img width="1919" height="951" alt="Image" src="https://github.com/user-attachments/assets/dfd076ce-de0a-40a1-9c36-d6a70a42e1ba" /> And this is also visible in the actual text, with a redundant "Part 3: Deployment at Scale" page: <img width="1919" height="948" alt="Image" src="https://github.com/user-attachments/assets/8f985f5d-c415-4338-bb4b-b1914ce146f2" /> Redundant page: <img width="1919" height="946" alt="Image" src="https://github.com/user-attachments/assets/6c83c575-ed13-4642-a401-2d4e1072da57" /> ### Expected Behavior The following behaviors are expected in true pdf: * The on Network Fabrics should start from Chapter 3 and not 4 and hence there should be 17 chapters in total. * The page numbers from chapter 10 should start from somewhere around 435 or 440 instead of 3 * The redundant page for Part 3: Deployment at Scale should not be there. ### Environment (TinyTorch bugs only) _No response_
GiteaMirror added the area: booktype: bugdependenciesbugpriority-high labels 2026-05-28 21:49:59 -05:00
Author
Owner

@profvjreddi commented on GitHub (May 28, 2026):

Thanks for the detailed report and screenshots, @obsessor-ak1. These point at exactly the right symptoms.

All three issues you're seeing trace to the same root cause. Vol2 was using a hybrid part-divider mechanism, where some parts were injected via LaTeX's \part{} command and others rendered only as a markdown # Part X: Title H1 in the parts QMD. The mismatch produced three things:

  1. Duplicate TOC entry for Network Fabrics. Part I's chapters were rendered both as part of the part page and again as a standalone H1 chapter entry.
  2. Roman numerals out of sync. The \stepcounter{part} command saw vol2's deployment part first, so it printed "Part I" where you'd expect "Part III" and so on. That's why the visible part labels and the rendered counter disagreed.
  3. Page numbers restarting at 3. When the part-page counter resets unexpectedly mid-volume, LaTeX's \frontmatter/\mainmatter page numbering can flip back to a fresh sequence.

The fix landed on dev on 2026-05-18 in 7423f6c1df, "refactor(parts): unify part-divider mechanism across both volumes." Every part now goes through exactly one \part{key:...} injection, the Roman counter increments correctly across all four parts (I, II, III, IV in order), and the # Part X: Title H1s in the parts QMD files were replaced with # Principles so they no longer compete with the divider page for the TOC slot.

The PDF you downloaded was built from vol2-v0.1.2 (tagged 2026-05-16), which predates this fix by two days. The fix is queued for the next vol2 release. Once that publishes, all three issues you flagged should be resolved together.

Closing as fixed-in-dev. Will tag the issue resolved after the next release ships.

<!-- gh-comment-id:4564060252 --> @profvjreddi commented on GitHub (May 28, 2026): Thanks for the detailed report and screenshots, @obsessor-ak1. These point at exactly the right symptoms. All three issues you're seeing trace to the same root cause. Vol2 was using a hybrid part-divider mechanism, where some parts were injected via LaTeX's `\part{}` command and others rendered only as a markdown `# Part X: Title` H1 in the parts QMD. The mismatch produced three things: 1. **Duplicate TOC entry for Network Fabrics**. Part I's chapters were rendered both as part of the part page and again as a standalone H1 chapter entry. 2. **Roman numerals out of sync**. The `\stepcounter{part}` command saw vol2's `deployment` part first, so it printed "Part I" where you'd expect "Part III" and so on. That's why the visible part labels and the rendered counter disagreed. 3. **Page numbers restarting at 3**. When the part-page counter resets unexpectedly mid-volume, LaTeX's `\frontmatter`/`\mainmatter` page numbering can flip back to a fresh sequence. The fix landed on `dev` on 2026-05-18 in [`7423f6c1df`](https://github.com/harvard-edge/cs249r_book/commit/7423f6c1df), "refactor(parts): unify part-divider mechanism across both volumes." Every part now goes through exactly one `\part{key:...}` injection, the Roman counter increments correctly across all four parts (I, II, III, IV in order), and the `# Part X: Title` H1s in the parts QMD files were replaced with `# Principles` so they no longer compete with the divider page for the TOC slot. The PDF you downloaded was built from `vol2-v0.1.2` (tagged 2026-05-16), which predates this fix by two days. The fix is queued for the next vol2 release. Once that publishes, all three issues you flagged should be resolved together. Closing as fixed-in-dev. Will tag the issue resolved after the next release ships.
Author
Owner

@profvjreddi commented on GitHub (May 28, 2026):

@all-contributors please add @obsessor-ak1 for bug in book

<!-- gh-comment-id:4564061108 --> @profvjreddi commented on GitHub (May 28, 2026): @all-contributors please add @obsessor-ak1 for bug in book
Author
Owner

@github-actions[bot] commented on GitHub (May 28, 2026):

I've added @obsessor-ak1 as a contributor to book! 🎉

Recognized for: bug, code
Project(s): book (detected from issue labels/title)
Based on: @all-contributors please add @obsessor-ak1 for bug

The contributor list has been updated in:

  • book/.all-contributorsrc, book/README.md
  • Main README.md

We love recognizing our contributors! ❤️

<!-- gh-comment-id:4564087604 --> @github-actions[bot] commented on GitHub (May 28, 2026): I've added @obsessor-ak1 as a contributor to **book**! :tada: **Recognized for:** bug, code **Project(s):** book (detected from issue labels/title) **Based on:** @all-contributors please add @obsessor-ak1 for bug The contributor list has been updated in: - `book/.all-contributorsrc`, `book/README.md` - Main `README.md` We love recognizing our contributors! :heart:
Author
Owner

@github-actions[bot] commented on GitHub (May 28, 2026):

I've added @obsessor-ak1 as a contributor to book! 🎉

Recognized for: bug, code
Project(s): book (explicitly mentioned in comment)
Based on: @all-contributors please add @obsessor-ak1 for bug in book

The contributor list has been updated in:

  • book/.all-contributorsrc, book/README.md
  • Main README.md

We love recognizing our contributors! ❤️

<!-- gh-comment-id:4564147255 --> @github-actions[bot] commented on GitHub (May 28, 2026): I've added @obsessor-ak1 as a contributor to **book**! :tada: **Recognized for:** bug, code **Project(s):** book (explicitly mentioned in comment) **Based on:** @all-contributors please add @obsessor-ak1 for bug in book The contributor list has been updated in: - `book/.all-contributorsrc`, `book/README.md` - Main `README.md` We love recognizing our contributors! :heart:
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cs249r_book#18071