Repository navigation
fix(templates): replace hardcoded total-pages in en/mcm and en/default Typst templates - #125
Merged
Merged
Conversation
… in en/mcm and en/default Both English Typst templates hardcoded the total page count as "4" in the page header, producing impossible headers like "Page 5 of 4" for any paper longer than 4 pages (i.e. every real submission). - en/mcm: total-pages now evaluates counter(page).final() minus the two front-matter pages (summary sheet + title page), matching the existing physical-page offset used for the current page number - en/default: total-pages now evaluates counter(page).final() directly Verified: both templates compile cleanly with typst 0.14 and produce consistent "Page N of N" headers on the final page.
Owner
|
tks!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Both English Typst templates hardcode the header's total page count:
Any paper longer than 4 pages — i.e. every real submission — gets impossible headers like "Page 5 of 4" / "Page 11 of 4". I hit this while running the full math-modeling workflow on HiMCM 2025 Problem A; the verification stage caught the broken header during PDF visual review.
Fix
en/mcm/main.typ:#let total-pages = context str(counter(page).final().first() - 2)— subtracts the two front-matter pages (summary sheet + title page), matching the existingphysical - 2offset already used for the current page number, so both sides of "Page X of Y" stay consistent.en/default/main.typ:#let total-pages = context str(counter(page).final().first())— that template's header usescounter(page).display()directly with no offset, so no subtraction.Verification
typst compilesucceeds for both templates.total-pages, so no other templates are affected.