From da8f7d9c4c8f7deb5ddec28cf68a6c30ae73bbbf Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Thu, 7 Jul 2022 13:37:53 +0300 Subject: [PATCH] LaTeX writer: add \label's for all index keys, not just first This change was originally added in coq project, but I am forwarding it here at request of the patch author. See https://github.com/coq/coq/issues/12361 for the issue description. --- sphinx/writers/latex.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index ffadb67aa5..447943c866 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -687,10 +687,10 @@ def _depart_signature_line(self, node: Element) -> None: self.body.append('}') def visit_desc_signature(self, node: Element) -> None: + hyper = '' if node.parent['objtype'] != 'describe' and node['ids']: - hyper = self.hypertarget(node['ids'][0]) - else: - hyper = '' + for id in node['ids']: + hyper += self.hypertarget(id) self.body.append(hyper) if not self.in_desc_signature: self.in_desc_signature = True