From a955a771779f8e9e3c8cea26e4a89ab7d64e1975 Mon Sep 17 00:00:00 2001
From: Marina Ganeva <m.ganeva@fz-juelich.de>
Date: Tue, 13 Nov 2018 12:58:34 +0100
Subject: [PATCH] Re #23953 Fix docs build for sphinx 1.8.1

---
 dev-docs/source/conf.py | 6 +++++-
 docs/source/conf.py     | 5 ++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/dev-docs/source/conf.py b/dev-docs/source/conf.py
index d4dc763ba77..8e39dfd9387 100644
--- a/dev-docs/source/conf.py
+++ b/dev-docs/source/conf.py
@@ -24,11 +24,15 @@ if sphinx_version > "1.6":
 extensions = [
     # we use pngmath over mathjax so that the the offline help isn't reliant on
     # anything external and we don't need to include the large mathjax package
-    'sphinx.ext.pngmath',
     'sphinx.ext.autodoc',
     'sphinx.ext.intersphinx'
 ]
 
+if sphinx_version > "1.8":
+    extensions.append('sphinx.ext.imgmath')
+else:
+    extensions.append('sphinx.ext.pngmath')
+
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
 
diff --git a/docs/source/conf.py b/docs/source/conf.py
index 2ab8f568b12..41971491c74 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -30,7 +30,6 @@ if sphinx_version > "1.6":
 extensions = [
      # we use pngmath over mathjax so that the the offline help isn't reliant on
      # anything external and we don't need to include the large mathjax package
-    'sphinx.ext.pngmath',
     'sphinx.ext.autodoc',
     'sphinx.ext.intersphinx',
     'sphinx.ext.doctest',
@@ -39,6 +38,10 @@ extensions = [
     'mantiddoc.doctest',
     'matplotlib.sphinxext.plot_directive'
 ]
+if sphinx_version > "1.8":
+    extensions.append('sphinx.ext.imgmath')
+else:
+    extensions.append('sphinx.ext.pngmath')
 
 # Add any paths that contain templates here, relative to this directory.
 templates_path = ['_templates']
-- 
GitLab