Fix #2348: Move amsmath and amssymb to before fontpkg on LaTeX writer

This commit is contained in:
Takeshi KOMIYA
2016-03-03 21:17:35 +09:00
parent da94ca5699
commit 2a2da13cde
4 changed files with 3 additions and 10 deletions

View File

@@ -37,6 +37,7 @@ Bugs fixed
* #2360: Fix numref in LaTeX output is broken * #2360: Fix numref in LaTeX output is broken
* #2361: Fix additional paragraphs inside the "compound" directive are indented * #2361: Fix additional paragraphs inside the "compound" directive are indented
* #2364: Fix KeyError 'rootSymbol' on Sphinx upgrade from older version. * #2364: Fix KeyError 'rootSymbol' on Sphinx upgrade from older version.
* #2348: Move amsmath and amssymb to before fontpkg on LaTeX writer.
Documentation Documentation
------------- -------------

View File

@@ -214,11 +214,6 @@ 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_config_value('math_number_all', False, 'html') app.add_config_value('math_number_all', False, 'html')
app.add_node(math, override=True, app.add_node(math, override=True,
@@ -243,4 +238,3 @@ 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.connect('builder-inited', setup_amsfont)

View File

@@ -14,8 +14,6 @@
\RequirePackage{fancybox} \RequirePackage{fancybox}
\RequirePackage{titlesec} \RequirePackage{titlesec}
\RequirePackage{tabulary} \RequirePackage{tabulary}
\RequirePackage{amsmath} % for \text
\RequirePackage{amssymb} % for some symbols
\RequirePackage{makeidx} \RequirePackage{makeidx}
\RequirePackage{framed} \RequirePackage{framed}
\RequirePackage{ifthen} \RequirePackage{ifthen}

View File

@@ -39,7 +39,7 @@ HEADER = r'''%% Generated by Sphinx.
%(utf8extra)s %(utf8extra)s
%(cmappkg)s %(cmappkg)s
%(fontenc)s %(fontenc)s
%(amsfonts)s %(amsmath)s
%(babel)s %(babel)s
%(fontpkg)s %(fontpkg)s
%(fncychap)s %(fncychap)s
@@ -279,7 +279,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
'\\else\\fi'), '\\else\\fi'),
'cmappkg': '\\usepackage{cmap}', 'cmappkg': '\\usepackage{cmap}',
'fontenc': '\\usepackage[T1]{fontenc}', 'fontenc': '\\usepackage[T1]{fontenc}',
'amsfonts': '', 'amsmath': '\\usepackage{amsmath,amssymb}',
'babel': '\\usepackage{babel}', 'babel': '\\usepackage{babel}',
'fontpkg': '\\usepackage{times}', 'fontpkg': '\\usepackage{times}',
'fncychap': '\\usepackage[Bjarne]{fncychap}', 'fncychap': '\\usepackage[Bjarne]{fncychap}',