mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-10-12 16:32:10 -05:00
Fix #2290: `sphinx.ext.mathbase` use of amsfonts may break user choice of math fonts
This commit is contained in:
1 parent
50f4862b06
commit
532e99c96b
3 files changed
+9
-1
No files matched your search
@@ -18,6 +18,7 @@ Bugs fixed
|
|||||||
* #2292: Fix some footnotes disappear from LaTeX output
|
* #2292: Fix some footnotes disappear from LaTeX output
|
||||||
* #2287: ``sphinx.transforms.Locale`` always uses rst parser. Sphinx i18n feature should
|
* #2287: ``sphinx.transforms.Locale`` always uses rst parser. Sphinx i18n feature should
|
||||||
support parsers that specified source_parsers.
|
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)
|
Release 1.3.5 (released Jan 24, 2016)
|
||||||
|
|||||||
@@ -207,6 +207,11 @@ def number_equations(app, doctree, docname):
|
|||||||
node[0] = nodes.Text(num, num)
|
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):
|
def setup_math(app, htmlinlinevisitors, htmldisplayvisitors):
|
||||||
app.add_node(math,
|
app.add_node(math,
|
||||||
latex=(latex_visit_math, None),
|
latex=(latex_visit_math, None),
|
||||||
@@ -230,4 +235,4 @@ def setup_math(app, htmlinlinevisitors, htmldisplayvisitors):
|
|||||||
app.add_role('eq', eq_role)
|
app.add_role('eq', eq_role)
|
||||||
app.add_directive('math', MathDirective)
|
app.add_directive('math', MathDirective)
|
||||||
app.connect('doctree-resolved', number_equations)
|
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
|
%(utf8extra)s
|
||||||
%(cmappkg)s
|
%(cmappkg)s
|
||||||
%(fontenc)s
|
%(fontenc)s
|
||||||
|
%(amsfonts)s
|
||||||
%(babel)s
|
%(babel)s
|
||||||
%(fontpkg)s
|
%(fontpkg)s
|
||||||
%(fncychap)s
|
%(fncychap)s
|
||||||
@@ -258,6 +259,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
|||||||
'utf8extra': '\\DeclareUnicodeCharacter{00A0}{\\nobreakspace}',
|
'utf8extra': '\\DeclareUnicodeCharacter{00A0}{\\nobreakspace}',
|
||||||
'cmappkg': '\\usepackage{cmap}',
|
'cmappkg': '\\usepackage{cmap}',
|
||||||
'fontenc': '\\usepackage[T1]{fontenc}',
|
'fontenc': '\\usepackage[T1]{fontenc}',
|
||||||
|
'amsfonts': '',
|
||||||
'babel': '\\usepackage{babel}',
|
'babel': '\\usepackage{babel}',
|
||||||
'fontpkg': '\\usepackage{times}',
|
'fontpkg': '\\usepackage{times}',
|
||||||
'fncychap': '\\usepackage[Bjarne]{fncychap}',
|
'fncychap': '\\usepackage[Bjarne]{fncychap}',
|
||||||
|
|||||||
Reference in new issue
Block a user