mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix #2290: `sphinx.ext.mathbase` use of amsfonts may break user choice of math fonts
This commit is contained in:
1
CHANGES
1
CHANGES
@@ -18,6 +18,7 @@ Bugs fixed
|
||||
* #2292: Fix some footnotes disappear from LaTeX output
|
||||
* #2287: ``sphinx.transforms.Locale`` always uses rst parser. Sphinx i18n feature should
|
||||
support parsers that specified source_parsers.
|
||||
* #2290: Fix ``sphinx.ext.mathbase`` use of amsfonts may break user choice of math fonts
|
||||
|
||||
|
||||
Release 1.3.5 (released Jan 24, 2016)
|
||||
|
||||
@@ -207,6 +207,11 @@ def number_equations(app, doctree, docname):
|
||||
node[0] = nodes.Text(num, num)
|
||||
|
||||
|
||||
def setup_amsfont(app):
|
||||
# use amsfonts if users do not configure latex_elements['amsfonts']
|
||||
app.config.latex_elements.setdefault('amsfonts', r'\usepackage{amsfonts}')
|
||||
|
||||
|
||||
def setup_math(app, htmlinlinevisitors, htmldisplayvisitors):
|
||||
app.add_node(math,
|
||||
latex=(latex_visit_math, None),
|
||||
@@ -230,4 +235,4 @@ def setup_math(app, htmlinlinevisitors, htmldisplayvisitors):
|
||||
app.add_role('eq', eq_role)
|
||||
app.add_directive('math', MathDirective)
|
||||
app.connect('doctree-resolved', number_equations)
|
||||
app.add_latex_package('amsfonts')
|
||||
app.connect('builder-inited', setup_amsfont)
|
||||
|
||||
@@ -37,6 +37,7 @@ HEADER = r'''%% Generated by Sphinx.
|
||||
%(utf8extra)s
|
||||
%(cmappkg)s
|
||||
%(fontenc)s
|
||||
%(amsfonts)s
|
||||
%(babel)s
|
||||
%(fontpkg)s
|
||||
%(fncychap)s
|
||||
@@ -258,6 +259,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
||||
'utf8extra': '\\DeclareUnicodeCharacter{00A0}{\\nobreakspace}',
|
||||
'cmappkg': '\\usepackage{cmap}',
|
||||
'fontenc': '\\usepackage[T1]{fontenc}',
|
||||
'amsfonts': '',
|
||||
'babel': '\\usepackage{babel}',
|
||||
'fontpkg': '\\usepackage{times}',
|
||||
'fncychap': '\\usepackage[Bjarne]{fncychap}',
|
||||
|
||||
Reference in New Issue
Block a user