From 8eddf3ab1e47788626f0589cdd39765aea0d8a6c Mon Sep 17 00:00:00 2001
From: Gerardo Tauriello <gerardo.tauriello@unibas.ch>
Date: Wed, 30 Jan 2019 18:52:09 +0100
Subject: [PATCH] Switch doc from sphinx.ext.imgmath to sphinx.ext.mathjax for
 rendering formulas

Copied change from PM3 (commit d16162baffb140de971e24aad71c8cce257a6fce).
---
 doc/conf/conf.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/doc/conf/conf.py b/doc/conf/conf.py
index 6f0f697f5..36e11cd09 100644
--- a/doc/conf/conf.py
+++ b/doc/conf/conf.py
@@ -32,7 +32,7 @@ import ost
 # Add any Sphinx extension module names here, as strings. They can be extensions
 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
 extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 
-              'sphinx.ext.coverage', 'sphinx.ext.pngmath',  
+              'sphinx.ext.coverage', 'sphinx.ext.mathjax',  
               'sphinx.ext.ifconfig']
 
 # Add any paths that contain templates here, relative to this directory.
@@ -100,6 +100,13 @@ modindex_common_prefix = ['ost.']
 
 # -- Options for HTML output ---------------------------------------------------
 
+# Since we use sphinx.ext.mathjax to render formulas on HTML pages: The
+# MathJax web-page deprecated their own CDN to serve JavaScript but it is
+# still the default for Sphinx. Here we redirect to the CDN recommended by
+# MathJax.
+mathjax_path = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML'
+# Look for "math" markup (e.g. ost.table.Table.GetOptimalPrefactors) to test
+
 # The theme to use for HTML and HTML Help pages.  Major themes that come with
 # Sphinx are currently 'default' and 'sphinxdoc'.
 html_theme = 'sphinxdoc'
-- 
GitLab