Skip to content

LaTeX: v3.5.1 verbatimmaxunderfull setting does not work as expected #8925

Closed

Description

@jfbu

Describe the bug
A clear and concise description of what the bug is.

At v3.5.1, a new latex key verbatimforcewraps was added to use with latex_elements['sphinxsetup'] to optionally trigger hard-wrap of code-blocks with unbreakable contents overflowing in margin. Secondary settings verbatimmaxunderfull (and overfull) governs the decision to hard-wrap.

But the underfull condition is too easy to occur, because the last line is taken into account. For example from

latex_elements = {
    'sphinxsetup': 'verbatimforcewraps, verbatimmaxunderfull=12',
}

and this

Test maxunderfull
=================

::

    myString = "aa aaaa aaaaaaaa aaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaa aa"

one obtains

Capture d’écran 2021-02-24 à 12 22 53

and not the expected

Capture d’écran 2021-02-24 à 12 32 37

where the first line obeys the <=12 char widths to right border and the hard wrap one sees in previous screenshot should thus not happen.

Environment info

  • OS: [e.g. Unix/Linux/Mac/Win/other with version]
  • Python version: [e.g. 3.7.1]
  • Sphinx version: 3.5.1
  • Sphinx extensions: [e.g. sphinx.ext.autodoc, recommonmark]
  • Extra tools: [e.g. Browser, tex or something else]

Related:

Activity

  1. added 3 commits that reference this issue on Feb 24, 2021
    e41cc76
    8fe25d0
    294870b
  2. added this to the 4.0.0 milestone on Feb 24, 2021
  3. jfbu commented on Feb 24, 2021

    @jfbu
    ContributorAuthor

    Fixed at 294870b (#8926)

  4. added a commit that references this issue on Mar 11, 2021
    3134085
  5. locked as resolved and limited conversation to collaborators on Jul 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions