Commits

Georg Brandl committed 8688ffc

Fix #722: remove special styling of :samp: role, and enable placeholder formatting in literal nodes.

Comments (0)

Files changed (2)

sphinx/texinputs/sphinx.sty

 \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.

sphinx/writers/latex.py

 
     def visit_literal(self, node):
         self.no_contractions += 1
-        content = self.encode(node.astext().strip())
+        if self.in_title:
+            self.body.append(r'\texttt{')
+        else:
+            self.body.append(r'\code{')
+    def depart_literal(self, node):
         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)
-        else:
-            self.body.append(r'\code{%s}' % content)
-        raise nodes.SkipNode
+        self.body.append('}')
 
     def visit_footnote_reference(self, node):
         num = node.astext().strip()