Skip to content

Commit 4112bb4

Browse files
committed
Only use imgmath when supported
1 parent f1358e3 commit 4112bb4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

doc/conf.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,19 @@
4141
'sphinx.ext.autosummary',
4242
'sphinx.ext.doctest',
4343
'sphinx.ext.intersphinx',
44-
'sphinx.ext.imgmath',
4544
'sphinx.ext.todo',
4645
'numpydoc',
4746
'sphinx.ext.ifconfig',
4847
'sphinx.ext.viewcode',
4948
]
5049

50+
try:
51+
import sphinx.ext.imgmath # noqa
52+
except ImportError:
53+
extensions.append('sphinx.ext.pngmath')
54+
else:
55+
extensions.append('sphinx.ext.imgmath')
56+
5157
# Add any paths that contain templates here, relative to this directory.
5258
templates_path = ['_templates']
5359

0 commit comments

Comments
 (0)