Skip to content

Commit 8c787f3

Browse files
committed
build doc fix, use sphinx4, mathjax2, html_css_files
1 parent 834c697 commit 8c787f3

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

Diff for: doc/conf.py

+17-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
extensions = [
3636
'sphinx.ext.autodoc',
3737
'sphinx.ext.autosummary',
38-
'sphinx.ext.mathjax',
3938
'sphinx.ext.viewcode',
4039
'sphinx.ext.napoleon', # support for NumPy-style docstrings
4140
'sphinx.ext.intersphinx',
@@ -95,7 +94,22 @@
9594
}
9695
plot_formats = ['svg', 'pdf']
9796

98-
mathjax_config = {
97+
# use mathjax2 with
98+
# https://github.com/spatialaudio/nbsphinx/issues/572#issuecomment-853389268
99+
# and 'TeX' dictionary
100+
# in future we might switch to mathjax3 once the
101+
# 'begingroup' extension is available
102+
# http://docs.mathjax.org/en/latest/input/tex/extensions/begingroup.html#begingroup
103+
# https://mathjax.github.io/MathJax-demos-web/convert-configuration/convert-configuration.html
104+
mathjax_path = ('https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js'
105+
'?config=TeX-AMS-MML_HTMLorMML')
106+
mathjax2_config = {
107+
'tex2jax': {
108+
'inlineMath': [['$', '$'], ['\\(', '\\)']],
109+
'processEscapes': True,
110+
'ignoreClass': 'document',
111+
'processClass': 'math|output_area',
112+
},
99113
'TeX': {
100114
'extensions': ['newcommand.js', 'begingroup.js'], # Support for \gdef
101115
},
@@ -219,9 +233,7 @@
219233

220234
# -- Options for HTML output ----------------------------------------------
221235

222-
def setup(app):
223-
"""Include custom theme files to sphinx HTML header"""
224-
app.add_stylesheet('css/title.css')
236+
html_css_files = ['css/title.css']
225237

226238
# The theme to use for HTML and HTML Help pages. See the documentation for
227239
# a list of builtin themes.

0 commit comments

Comments
 (0)