diff options
| -rw-r--r-- | sphinx/texinputs/sphinx.sty | 1 | ||||
| -rw-r--r-- | sphinx/writers/latex.py | 12 |
2 files changed, 5 insertions, 8 deletions
diff --git a/sphinx/texinputs/sphinx.sty b/sphinx/texinputs/sphinx.sty index 21a3d894..ef7b891b 100644 --- a/sphinx/texinputs/sphinx.sty +++ b/sphinx/texinputs/sphinx.sty @@ -128,7 +128,6 @@ \newcommand{\strong}[1]{{\bf #1}} \newcommand{\code}[1]{\texttt{#1}} \newcommand{\bfcode}[1]{\code{\bfseries#1}} -\newcommand{\samp}[1]{`\code{#1}'} \newcommand{\email}[1]{\textsf{#1}} % Redefine the Verbatim environment to allow border and background colors. diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index d9f1fad9..d4b2695a 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -1246,15 +1246,13 @@ class LaTeXTranslator(nodes.NodeVisitor): def visit_literal(self, node): self.no_contractions += 1 - content = self.encode(node.astext().strip()) - self.no_contractions -= 1 if self.in_title: - self.body.append(r'\texttt{%s}' % content) - elif node.get('role') == 'samp': - self.body.append(r'\samp{%s}' % content) + self.body.append(r'\texttt{') else: - self.body.append(r'\code{%s}' % content) - raise nodes.SkipNode + self.body.append(r'\code{') + def depart_literal(self, node): + self.no_contractions -= 1 + self.body.append('}') def visit_footnote_reference(self, node): num = node.astext().strip() |
