mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
latex: add support for UTF-8 non-breaking spaces, and reintroduce them in autosummary
This commit is contained in:
@@ -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 -----------------------------------------------------------
|
||||
|
||||
|
||||
@@ -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}',
|
||||
|
||||
Reference in New Issue
Block a user