8000 LaTeX: improve behavious of `\pysigline` and `\pysiglinewithargsret` in case of multi-line signature by jfbu · Pull Request #8997 · sphinx-doc/sphinx · GitHub
[go: up one dir, main page]

Skip to content

LaTeX: improve behavious of \pysigline and \pysiglinewithargsret in case of multi-line signature #8997

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 14, 2021

Conversation

jfbu
Copy link
Contributor
@jfbu jfbu commented Mar 13, 2021

Bugfix

Closes: #7241, #8980, #8995

Regarding #7241, the fix is minimal it produces output like this
Capture d’écran 2021-03-13 à 17 14 20

The mechanism for signature works in indented context like this (which uses "quoted" indentation so it is on both sides)

Capture d’écran 2021-03-13 à 17 15 16

An example from our docs:

with this PR:

Capture d’écran 2021-03-13 à 17 16 49

without this PR:
Capture d’écran 2021-03-13 à 17 22 22

Notice also vertical spacing between signature and description is improved.

Relates indirectly: #1514

No direct incidence as \pysiglinewithargsret already used a \parbox we are only adding \raggedright and a final strut. But mentioning #1514 in this context due to recent #1514 (comment), and also because the above screenshots show that indeed achieving one argument per line would be much better. But this PR is not involved in this directly.

Copy link
Member
@tk0miya tk0miya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool!

@jfbu
Copy link
Contributor Author
jfbu commented Mar 14, 2021

Thanks as always! merging

@jfbu jfbu merged commit 2934aac into sphinx-doc:master Mar 14, 2021
@jfbu jfbu deleted the latex_pysigline branch March 14, 2021 20:45
jfbu added a commit to jfbu/sphinx that referenced this pull request Mar 15, 2021
Reason is that mark-up such as this:

   .. attribute:: state
                  state_machine

      The state and state machine which controls the parsing.  Used for
      ``nested_parse``.

generates two `\pysigline` each with `\phantomsection`. The latex code
to get good vertical spacing between label and its description, if label
``\parbox`` is multi-line, cause in this context the two (generally,
single-line) labels to be stacked vertically with no spacing.

This commit keeps the ``\parbox`` which fixes sphinx-doc#8980, but drops the
attempt to correct vertical distance to description, so as to not alter
the possibly more common use case of items with common description.
jfbu added a commit that referenced this pull request Mar 15, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0