Repository navigation
fix: keep the Typst title bar with its code - #80
Merged
Merged
Conversation
When a code window started near the bottom of a page, Typst could break the page right after the title bar, leaving it alone there while the code moved to the next page. The title bar block is now sticky, so it moves with the first lines of code. Long code still splits across pages.
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.
In Typst output, a code window that starts near the bottom of a page can leave its title bar there alone, while the code moves to the next page.
This puts
sticky: trueback on the title-bar block, so the title bar now moves with the first lines of its code.Release 1.2.1 removed
sticky(#35) because Typst 0.13 and older pushed a window close to a page in height whole to the next page, which left near-empty pages behind.Quarto 1.10.19, the minimum this extension now requires, bundles Typst 0.15.1.
That version breaks a tall window from the page it starts on, with or without
sticky.A new fixture places a plain window and an annotated window where only the title bar fits, and a 60-line window after a heading.
The tests check that each title bar shares a page with its first line of code, and that the tall window starts on the current page.
They then render again without
stickyand expect the title bar to land alone, which proves the fixture still forces the break.The page-break tests read the PDF text with
pdftotextfrom poppler.