From 1dd46f67bc60c75904fbe9a48ede048d36f22a54 Mon Sep 17 00:00:00 2001 From: Aaron Zuspan Date: Sun, 21 Nov 2021 10:20:29 -0800 Subject: [PATCH] Add MathJax workaround for rendering plotly figures in notebooks --- docs/conf.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index 7a2b55c..a277c97 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -82,3 +82,18 @@ html_static_path = ["_static"] autodoc_mock_imports = ["ee", "rasterio", "tqdm", "joblib", "plotly"] + + +# Workaround to make Plotly graphs appear in Jupyter notebooks. +# https://github.com/spatialaudio/nbsphinx/issues/572#issuecomment-853389268 +mathjax_path = ( + "https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js?config=TeX-AMS-MML_HTMLorMML" +) +mathjax2_config = { + "tex2jax": { + "inlineMath": [["$", "$"], ["\\(", "\\)"]], + "processEscapes": True, + "ignoreClass": "document", + "processClass": "math|output_area", + } +}