diff --git a/CHANGES b/CHANGES index 4904249e0..80899c844 100644 --- a/CHANGES +++ b/CHANGES @@ -13,6 +13,7 @@ Features added * #2245: Add ``latex_elements["passoptionstopackages"]`` option to call PassOptionsToPackages in early stage of preambles. * PR #2340: Math extension: support alignment of multiple equations for MathJAX. +* #2338: Define ``\titlereference`` macro to redefine the style of `title-reference` roles. Bugs fixed ---------- diff --git a/sphinx/texinputs/sphinx.sty b/sphinx/texinputs/sphinx.sty index 8e40a13ae..dc8bbdd5f 100644 --- a/sphinx/texinputs/sphinx.sty +++ b/sphinx/texinputs/sphinx.sty @@ -146,6 +146,7 @@ \newcommand{\bfcode}[1]{\code{\bfseries#1}} \newcommand{\email}[1]{\textsf{#1}} \newcommand{\tablecontinued}[1]{\textsf{#1}} +\newcommand{\titlereference}[1]{\emph{#1}} % Redefine the Verbatim environment to allow border and background colors. % The original environment is still used for verbatims within tables. diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index d86a0d68c..bc2baf50a 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -1699,7 +1699,7 @@ class LaTeXTranslator(nodes.NodeVisitor): return self.depart_literal_emphasis(node) def visit_title_reference(self, node): - self.body.append(r'\emph{') + self.body.append(r'\titlereference{') def depart_title_reference(self, node): self.body.append('}')