latex: add support for UTF-8 non-breaking spaces, and reintroduce them in autosummary

This commit is contained in:
Pauli Virtanen
2009-04-05 00:17:47 +03:00
parent a888b24979
commit 9cfdf9b13e
2 changed files with 6 additions and 3 deletions

View File

@@ -259,8 +259,8 @@ class Autosummary(Directive):
table = nodes.table('')
group = nodes.tgroup('', cols=2)
table.append(group)
group.append(nodes.colspec('', colwidth=30))
group.append(nodes.colspec('', colwidth=70))
group.append(nodes.colspec('', colwidth=10))
group.append(nodes.colspec('', colwidth=90))
body = nodes.tbody('')
group.append(body)
@@ -319,7 +319,8 @@ def mangle_signature(sig, max_chars=30):
else:
sig = ", ".join(args)
return "(%s)" % sig
sig = unicode(sig).replace(u" ", u"\u00a0")
return u"(%s)" % sig
# -- Importing items -----------------------------------------------------------

View File

@@ -30,6 +30,7 @@ from sphinx.util.smartypants import educateQuotesLatex
HEADER = r'''%% Generated by Sphinx.
\documentclass[%(papersize)s,%(pointsize)s%(classoptions)s]{%(docclass)s}
%(inputenc)s
%(utf8extra)s
%(fontenc)s
%(babel)s
%(fontpkg)s
@@ -136,6 +137,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
'pointsize': '10pt',
'classoptions': '',
'inputenc': '\\usepackage[utf8]{inputenc}',
'utf8extra': '\\DeclareUnicodeCharacter{00A0}{\nobreakspace}',
'fontenc': '\\usepackage[T1]{fontenc}',
'babel': '\\usepackage{babel}',
'fontpkg': '\\usepackage{times}',