From b175252162a8988ff5e6e52b2c618bd8ccc603ed Mon Sep 17 00:00:00 2001 From: Stephannie Jimenez Date: Mon, 16 May 2022 12:31:25 -0500 Subject: [PATCH] add sphinx math dollar extension --- requirements.txt | 1 + spec/conf.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/requirements.txt b/requirements.txt index 4741c6dc8..230413784 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,3 +4,4 @@ myst-parser sphinx_markdown_tables sphinx_copybutton docutils<0.18 +sphinx-math-dollar diff --git a/spec/conf.py b/spec/conf.py index bbb2f5d1d..4813d1420 100644 --- a/spec/conf.py +++ b/spec/conf.py @@ -40,6 +40,8 @@ 'sphinx.ext.autosummary', 'sphinx.ext.napoleon', 'sphinx.ext.autodoc', + 'sphinx_math_dollar', + 'sphinx.ext.mathjax' ] autosummary_generate = True @@ -48,6 +50,21 @@ napoleon_custom_sections = [('Returns', 'params_style')] default_role = 'code' +# Mathjax configuration +mathjax_config = { + 'tex2jax': { + 'inlineMath': [ ["\\(","\\)"] ], + 'displayMath': [["\\[","\\]"] ], + }, +} + +mathjax3_config = { + "tex": { + "inlineMath": [['\\(', '\\)']], + "displayMath": [["\\[", "\\]"]], + } +} + # nitpicky = True makes Sphinx warn whenever a cross-reference target can't be # found. nitpicky = True