diff --git a/doc/conf.py.in b/doc/conf.py.in
index d47f5add2ef4cbaec19ec243afe2c606166be915..394831ba4302622ad01e13edc68eb9aa29e15de5 100644
--- a/doc/conf.py.in
+++ b/doc/conf.py.in
@@ -37,7 +37,7 @@ extensions = ['sphinx.ext.autodoc',
               'sphinx.ext.intersphinx',
               'sphinx.ext.todo',
               'sphinx.ext.coverage',
-              'sphinx.ext.pngmath',
+              'sphinx.ext.mathjax',
               'sphinx.ext.ifconfig',
               'sphinx.ext.viewcode',
               'sphinx.ext.extlinks', 'cmake']
@@ -107,6 +107,13 @@ pygments_style = 'sphinx'
 
 # -- 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'
+
+
 # The theme to use for HTML and HTML Help pages.  See the documentation for
 # a list of builtin themes.
 html_theme = 'alabaster'