Skip to content

Commit b60e96f

Browse files
committed
Merge branch 'stable'
2 parents b780d22 + 4cc2d01 commit b60e96f

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

Diff for: CHANGES

+2
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ Bugs fixed
154154
* #2292: Fix some footnotes disappear from LaTeX output
155155
* #2287: ``sphinx.transforms.Locale`` always uses rst parser. Sphinx i18n feature should
156156
support parsers that specified source_parsers.
157+
* #2290: Fix ``sphinx.ext.mathbase`` use of amsfonts may break user choice of math fonts
158+
* #2324: Print a hint how to increase the recursion limit when it is hit.
157159

158160

159161
Release 1.3.5 (released Jan 24, 2016)

Diff for: sphinx/cmdline.py

+8
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,14 @@ def main(argv):
270270
print(red('The full traceback has been saved in %s, if you want '
271271
'to report the issue to the developers.' % tbpath),
272272
file=error)
273+
elif isinstance(err, RuntimeError) and 'recursion depth' in str(err):
274+
print(red('Recursion error:'), file=error)
275+
print(terminal_safe(text_type(err)), file=error)
276+
print(file=error)
277+
print('This can happen with very large or deeply nested source '
278+
'files. You can carefully increase the default Python '
279+
'recursion limit of 1000 in conf.py with e.g.:', file=error)
280+
print(' import sys; sys.setrecursionlimit(1500)', file=error)
273281
else:
274282
print(red('Exception occurred:'), file=error)
275283
print(format_exception_cut_frames().rstrip(), file=error)

Diff for: sphinx/ext/mathbase.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,11 @@ def number_equations(app, doctree, docname):
214214
node[0] = nodes.Text(num, num)
215215

216216

217+
def setup_amsfont(app):
218+
# use amsfonts if users do not configure latex_elements['amsfonts']
219+
app.config.latex_elements.setdefault('amsfonts', r'\usepackage{amsfonts}')
220+
221+
217222
def setup_math(app, htmlinlinevisitors, htmldisplayvisitors):
218223
app.add_config_value('math_number_all', False, 'html')
219224
app.add_node(math, override=True,
@@ -238,4 +243,4 @@ def setup_math(app, htmlinlinevisitors, htmldisplayvisitors):
238243
app.add_role('eq', eq_role)
239244
app.add_directive('math', MathDirective)
240245
app.connect('doctree-resolved', number_equations)
241-
app.add_latex_package('amsfonts')
246+
app.connect('builder-inited', setup_amsfont)

Diff for: sphinx/writers/latex.py

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
%(utf8extra)s
3939
%(cmappkg)s
4040
%(fontenc)s
41+
%(amsfonts)s
4142
%(babel)s
4243
%(fontpkg)s
4344
%(fncychap)s
@@ -276,6 +277,7 @@ class LaTeXTranslator(nodes.NodeVisitor):
276277
'\\else\\fi'),
277278
'cmappkg': '\\usepackage{cmap}',
278279
'fontenc': '\\usepackage[T1]{fontenc}',
280+
'amsfonts': '',
279281
'babel': '\\usepackage{babel}',
280282
'fontpkg': '\\usepackage{times}',
281283
'fncychap': '\\usepackage[Bjarne]{fncychap}',

0 commit comments

Comments
 (0)