From 34b6bea6a87a0b3072365cc042152943dddce0a3 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sat, 28 Apr 2018 17:03:56 +0900 Subject: [PATCH] Fix longest_label should be escaped --- sphinx/writers/latex.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index 64a7376c5..bb7dc83ac 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -2139,7 +2139,8 @@ class LaTeXTranslator(nodes.NodeVisitor): # adjust max width of citation labels not to break the layout longest_label = longest_label[:MAX_CITATION_LABEL_LENGTH] - self.body.append(u'\n\\begin{sphinxthebibliography}{%s}\n' % longest_label) + self.body.append(u'\n\\begin{sphinxthebibliography}{%s}\n' % + self.encode(longest_label)) def depart_thebibliography(self, node): # type: (nodes.Node) -> None