mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
LaTeX: partially revert #8997 \pysigline
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 #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.
This commit is contained in:
@@ -91,14 +91,20 @@
|
||||
% \relax only ends its "dimen" part
|
||||
\py@argswidth=\dimexpr\linewidth+\labelwidth\relax\relax
|
||||
\item[{\parbox[t]{\py@argswidth}{\raggedright #1\strut}}]
|
||||
% this strange incantation is because at its root LaTeX in fact did not
|
||||
% imagine a multi-line label, it is always wrapped in a horizontal box at core
|
||||
% LaTeX level and we have to find tricks to get correct interline distances.
|
||||
\leavevmode\par\nobreak\vskip-\parskip\prevdepth\dp\strutbox}
|
||||
% contrarily to \pysiglinewithargsret, we do not do this:
|
||||
% \leavevmode\par\nobreak\vskip-\parskip\prevdepth\dp\strutbox
|
||||
% which would give exact vertical spacing if item parbox is multi-line,
|
||||
% as it affects negatively more common situation of \pysigline
|
||||
% used twice or more in a row for labels sharing common description,
|
||||
% due to bad interaction with the \phantomsection in the mark-up
|
||||
}
|
||||
\newcommand{\pysiglinewithargsret}[3]{%
|
||||
\settowidth{\py@argswidth}{#1\sphinxcode{(}}%
|
||||
\py@argswidth=\dimexpr\linewidth+\labelwidth-\py@argswidth\relax\relax
|
||||
\item[{#1\sphinxcode{(}\py@sigparams{#2}{#3}}]
|
||||
% this strange incantation is because at its root LaTeX in fact did not
|
||||
% imagine a multi-line label, it is always wrapped in a horizontal box at core
|
||||
% LaTeX level and we have to find tricks to get correct interline distances.
|
||||
\leavevmode\par\nobreak\vskip-\parskip\prevdepth\dp\strutbox}
|
||||
\newcommand{\pysigstartmultiline}{%
|
||||
\def\pysigstartmultiline{\vskip\smallskipamount\parskip\z@skip\itemsep\z@skip}%
|
||||
|
||||
Reference in New Issue
Block a user