mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #722: remove special styling of :samp: role, and enable placeholder formatting in literal nodes.
This commit is contained in:
parent
1e05041ea5
commit
6d6e6abfdb
@ -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.
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user