LaTeX: avoid a footnote in a signature line executing \label twice

The signature may contain an auto-generated footnote, which now
always sets a label (formerly this happened only for multiply
referred-to footnotes so the problem did not arise).
This commit is contained in:
jfbu 2022-02-14 10:41:45 +01:00
parent 33cc980cec
commit a1d9127725

View File

@ -137,7 +137,11 @@
\pysigadjustitemsep
}
\newcommand{\pysiglinewithargsret}[3]{%
% as #1 may contain a footnote using \label we need to make \label
% a no-op here to avoid LaTeX complaining about duplicates
\let\spx@label\label\let\label\@gobble
\settowidth{\py@argswidth}{#1\sphinxcode{(}}%
\let\label\spx@label
\py@argswidth=\dimexpr\linewidth+\labelwidth-\py@argswidth\relax\relax
\item[{#1\sphinxcode{(}\py@sigparams{#2}{#3}\strut}]
\pysigadjustitemsep