From f30f1fa1a1a2aecdd12cc9b63de5d005565264dd Mon Sep 17 00:00:00 2001 From: Joel Nothman Date: Thu, 2 Nov 2017 18:27:38 +1100 Subject: [PATCH] Set LaTeX bibitem id to citation node id In the unusual case that the textual label differs from the ID, the ID should be preferred. --- sphinx/writers/latex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index 98d42c4ffab..53891654e6e 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -919,7 +919,7 @@ def depart_document(self, node): target = self.hypertarget(bi[2] + ':' + bi[3], withdoc=False) self.body.append(u'\\bibitem[%s]{%s}{%s %s}\n' % - (self.encode(bi[0]), self.idescape(bi[0]), + (self.encode(bi[3]), self.idescape(bi[0]), target, bi[1])) self.body.append(u'\\end{sphinxthebibliography}\n') self.bibitems = []