Repository navigation
fix(latex): keep the first-line indentation of code environments - #4502
Merged
DanielNg0729 merged 2 commits intoOct 3, 2026
Merged
Conversation
Signed-off-by: Ankit Kumar <ankitkumar19473@gmail.com>
Contributor
|
✅ DCO Check Passed Thanks @ankit2235, all your commits are properly signed off. 🎉 |
Contributor
Merge Protections🟢 Merge protection satisfied — ready to merge. Show 1 satisfied protection🟢 Enforce conventional commitMake sure that we follow https://www.conventionalcommits.org/en/v1.0.0/
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
DanielNg0729
self-requested a review
October 3, 2026 12:04
DanielNg0729
requested changes
Oct 3, 2026
DanielNg0729
left a comment
Member
There was a problem hiding this comment.
Thank you @ankit2235 for this fix and for keeping it consistent with #4487!
One small could you delete the comment inside the code, i feel like the PR body is enough to describe this fix and also 1 small fix here
Signed-off-by: Ankit Kumar <ankitkumar19473@gmail.com>
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.
Same fix as #4487, for the LaTeX backend.
_extract_verbatim_contentreturnedmatch.group(1).strip(), which removed the leading indentation of the first code line while later lines kept theirs, so the relative indentation ofverbatimandlstlistingcode changed.This trims only line breaks before the code and whitespace after it (
lstrip("\r\n").rstrip()), keeping the first line's indentation. Code whose first line is not indented is unchanged.The new test is parametrized over
verbatimandlstlisting. It fails onmainand passes with this change. The existing LaTeX tests, including the e2e groundtruth comparison, pass unchanged.Issue resolved by this Pull Request:
Resolves #4501
Checklist: