Conversation
Formerly, PDF rendering crashed for inputs of more than about 1350
codelines either from a code-block, or from a literal include, when this
literal include used the sphinxVerbatim and not the sphinxalltt route.
The fix goes via novel mark-up which is applied in case the literally
included file or code-block contains more than 500 codelines. Then
chunks of 500 consecutive source codelines are rendered using:
sphinxLongVerbatimFirst, sphinxLongVerbatimMiddle, and
sphinxLongVerbatimLast.
Efforts have been devoted for line numbering and emphasizing to not be
modified, and (if so configured) for bottom captions to appear where
expected.
It was needed to (to cut into smaller pieces and) modify in a very
limited manner the legacy sphinxVerbatim which is still used for up to
500 codelines, which corresponds to about 10 a4-sized pages, if document
is with default pointsize and margins.
Hopefully no consequences will arise from these changes.
Known issue: in the unlikely event a pagebreak happens exactly after a
chunk of 500 code lines, the continuation hints usually printed at
bottom and top of pages are omitted.
jfbu
added a commit
to jfbu/sphinx
that referenced
this pull request
Dec 26, 2025
jfbu
added a commit
that referenced
this pull request
Dec 26, 2025
AA-Turner
pushed a commit
to pradyunsg/sphinx
that referenced
this pull request
Dec 31, 2025
Formerly, PDF rendering crashed for inputs of more than about 1350 codelines either from a code-block, or from a literal include, when this literal include used the sphinxVerbatim and not the sphinxalltt route. The fix goes via novel mark-up which is applied in case the literally included file or code-block contains more than 500 codelines. Then chunks of 500 consecutive source codelines are rendered using: sphinxLongVerbatimFirst, sphinxLongVerbatimMiddle, and sphinxLongVerbatimLast. Efforts have been devoted for line numbering and emphasizing to not be modified, and (if so configured) for bottom captions to appear where expected. It was needed to (to cut into smaller pieces and) modify in a very limited manner the legacy sphinxVerbatim which is still used for up to 500 codelines, which corresponds to about 10 a4-sized pages, if document is with default pointsize and margins. Hopefully no consequences will arise from these changes. Known issue: in the unlikely event a pagebreak happens exactly after a chunk of 500 code lines, the continuation hints usually printed at bottom and top of pages are omitted.
AA-Turner
pushed a commit
to pradyunsg/sphinx
that referenced
this pull request
Dec 31, 2025
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Formerly, PDF rendering crashed for inputs of more than about 1350 codelines either from a code-block, or from a literal include, when this literal include used the sphinxVerbatim and not the sphinxalltt route.
The fix goes via novel mark-up which is applied in case the literally included file or code-block contains more than 500 codelines. Then chunks of 500 consecutive source codelines are rendered using:
Efforts have been devoted for line numbering and emphasizing to not be modified, and (if so configured) for bottom captions to appear where expected.
It was needed to (to cut into smaller pieces and) modify in a very limited manner the legacy sphinxVerbatim which is still used for up to 500 codelines, which corresponds to about 10 a4-sized pages, if document is with default pointsize and margins.
Hopefully no consequences will arise from these changes.
Known issue: in the unlikely event a pagebreak happens exactly after a chunk of 500 code lines, the continuation hints usually printed at bottom and top of pages are omitted.
Fix #3099