sphinx-doc / sphinx-doc/sphinx
LaTeX: enable linebreaks at spaces and punctuation for tokens with a background color attributed by a Pygments style
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
This is motivated by #5974, in the light of #8854 new verbatimforcewraps, which is an optional feature for Sphinx 3.5.0.
Wrapping of long code lines in latexpdf output is done since Sphinx 1.4.2 (#2343). It happens at spaces and also at ascii punctuation. Sometimes a string has no breakpoints (typically an hexstring #8849, or any string composed only of digits and letters) and if it is too long it then moves to next line and may even then overflow into margin if long enough. With #8854 this is fixed optionally by allowing breakpoints at every character.
The #8854 (which will be part of Sphinx 3.5.0) works even if the characters are part of a token which is rendered by the Pygments style with a colored background. See https://github.com/sphinx-doc/sphinx/issues/5974#issuecomment-776283378 for an example.
This feature request is for an intermediate solution for colored backgrounds which is to let linebreaks happen as if there was no background color.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the referenced issues #8854, #5974, and #8849 to understand the existing LaTeX PDF wrapping behavior and the background-color case. Done means allowing line breaks at spaces and ASCII punctuation in background-colored tokens, without requiring a break at every character.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- latex, python
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100