Skip to content

Commit 0776abe

Browse files
committed
Proper handling of "mathjax_config"
1 parent 3ac3d62 commit 0776abe

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/nbsphinx.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1696,14 +1696,16 @@ def setup(app):
16961696
rst.directives.register_directive('code', sphinx.directives.code.CodeBlock)
16971697

16981698
# Work-around until https://github.com/sphinx-doc/sphinx/pull/5504 is done:
1699-
app.config._raw_config.setdefault('mathjax_config', {
1700-
'tex2jax': {
1699+
mathjax_config = app.config._raw_config.setdefault('mathjax_config', {})
1700+
mathjax_config.setdefault(
1701+
'tex2jax',
1702+
{
17011703
'inlineMath': [['$', '$'], ['\\(', '\\)']],
17021704
'processEscapes': True,
17031705
'ignoreClass': '.*',
17041706
'processClass': 'math',
17051707
}
1706-
})
1708+
)
17071709

17081710
# Add LaTeX definitions to preamble
17091711
latex_elements = app.config._raw_config['latex_elements']

0 commit comments

Comments
 (0)