From 54c5eb4db099bfc3cbb1cad139522b92badccc47 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Mon, 26 Jan 2009 23:11:34 +0100 Subject: [PATCH] Prevent double hyphens becoming en-dashes in literal code in the LaTeX output. --- CHANGES | 3 +++ sphinx/latexwriter.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index 7e343b8825..4ce090ac06 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,9 @@ Release 0.5.2 (in development) ============================== +* Prevent double hyphens becoming en-dashes in literal code in + the LaTeX output. + * Open literalinclude files in universal newline mode to allow arbitrary newline conventions. diff --git a/sphinx/latexwriter.py b/sphinx/latexwriter.py index bfc9165acd..2f871a5cd4 100644 --- a/sphinx/latexwriter.py +++ b/sphinx/latexwriter.py @@ -978,7 +978,9 @@ class LaTeXTranslator(nodes.NodeVisitor): raise nodes.SkipNode 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.has_key('role') and node['role'] == 'samp':