diff --git a/sphinx/texinputs/sphinx.sty b/sphinx/texinputs/sphinx.sty index 1a006cb40..e3d7ce9b8 100644 --- a/sphinx/texinputs/sphinx.sty +++ b/sphinx/texinputs/sphinx.sty @@ -1243,6 +1243,10 @@ \protected\def\sphinxstyleabbreviation {\textsc} \protected\def\sphinxstyleliteralintitle {\sphinxcode} +% LaTeX writer uses macros to hide double quotes from \sphinxcode's \@noligs +\protected\def\sphinxquotedblleft{``} +\protected\def\sphinxquotedblright{''} + % stylesheet for highlighting with pygments \RequirePackage{sphinxhighlight} diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index 6e408448d..e6761be51 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -2209,7 +2209,9 @@ class LaTeXTranslator(nodes.NodeVisitor): def visit_Text(self, node): text = self.encode(node.astext()) if not self.no_contractions and not self.in_parsed_literal: - text = educate_quotes_latex(text) + text = educate_quotes_latex(text, + dquotes=("\\sphinxquotedblleft{}", + "\\sphinxquotedblright{}")) self.body.append(text) def depart_Text(self, node):