|
58 | 58 |
|
59 | 59 | % {fulllineitems} is the main environment for object descriptions.
|
60 | 60 | %
|
61 |
| -\newcommand{\py@itemnewline}[1]{% |
62 |
| - \kern\labelsep |
63 |
| - \@tempdima\linewidth |
64 |
| - \advance\@tempdima \labelwidth\makebox[\@tempdima][l]{#1}% |
65 |
| - \kern-\labelsep |
| 61 | +% With 4.0.0 \pysigline (and \pysiglinewithargsret), used in a fulllineitems |
| 62 | +% environment the #1 will already be of the width which is computed here, i.e. |
| 63 | +% the available width on line, so the \makebox becomes a bit superfluous |
| 64 | +\newcommand{\py@itemnewline}[1]{% macro used as \makelabel in fulllineitems |
| 65 | +% Memo: this presupposes \itemindent is 0pt |
| 66 | + \kern\labelsep % because \@labels core latex box does \hskip-\labelsep |
| 67 | + \makebox[\dimexpr\linewidth+\labelwidth\relax][l]{#1}% |
| 68 | + \kern-\labelsep % because at end of \@labels box there is \hskip\labelsep |
66 | 69 | }
|
67 | 70 |
|
68 | 71 | \newenvironment{fulllineitems}{%
|
|
76 | 79 | %
|
77 | 80 | \newlength{\py@argswidth}
|
78 | 81 | \newcommand{\py@sigparams}[2]{%
|
79 |
| - \parbox[t]{\py@argswidth}{#1\sphinxcode{)}#2}} |
80 |
| -\newcommand{\pysigline}[1]{\item[{#1}]} |
| 82 | + % The \py@argswidth has been computed in \pysiglinewithargsret to make this |
| 83 | + % occupy full available width on line. |
| 84 | + \parbox[t]{\py@argswidth}{\raggedright #1\sphinxcode{)}#2\strut}% |
| 85 | + % final strut is to help get correct vertical separation in case of multi-line |
| 86 | + % box with the item contents. |
| 87 | +} |
| 88 | +\newcommand{\pysigline}[1]{% |
| 89 | +% the \py@argswidth is available we use it despite its name (no "args" here) |
| 90 | +% the \relax\relax is because \py@argswidth is a "skip" variable and the first |
| 91 | +% \relax only ends its "dimen" part |
| 92 | + \py@argswidth=\dimexpr\linewidth+\labelwidth\relax\relax |
| 93 | + \item[{\parbox[t]{\py@argswidth}{\raggedright #1\strut}}] |
| 94 | +% this strange incantation is because at its root LaTeX in fact did not |
| 95 | +% imagine a multi-line label, it is always wrapped in a horizontal box at core |
| 96 | +% LaTeX level and we have to find tricks to get correct interline distances. |
| 97 | + \leavevmode\par\nobreak\vskip-\parskip\prevdepth\dp\strutbox} |
81 | 98 | \newcommand{\pysiglinewithargsret}[3]{%
|
82 | 99 | \settowidth{\py@argswidth}{#1\sphinxcode{(}}%
|
83 |
| - \addtolength{\py@argswidth}{-2\py@argswidth}% |
84 |
| - \addtolength{\py@argswidth}{\linewidth}% |
85 |
| - \item[{#1\sphinxcode{(}\py@sigparams{#2}{#3}}]} |
| 100 | + \py@argswidth=\dimexpr\linewidth+\labelwidth-\py@argswidth\relax\relax |
| 101 | + \item[{#1\sphinxcode{(}\py@sigparams{#2}{#3}}] |
| 102 | + \leavevmode\par\nobreak\vskip-\parskip\prevdepth\dp\strutbox} |
86 | 103 | \newcommand{\pysigstartmultiline}{%
|
87 | 104 | \def\pysigstartmultiline{\vskip\smallskipamount\parskip\z@skip\itemsep\z@skip}%
|
88 | 105 | \edef\pysigstopmultiline
|
|
0 commit comments