From 2be07a8e179d11cdd20520da501c14c4ffd96841 Mon Sep 17 00:00:00 2001
From: Martyn Gigg <martyn.gigg@stfc.ac.uk>
Date: Wed, 4 Jun 2014 14:18:32 +0100
Subject: [PATCH] Use latex preview package to vertically align equations
 correctly.

Refs #9595
---
 Code/Mantid/docs/source/conf.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/Code/Mantid/docs/source/conf.py b/Code/Mantid/docs/source/conf.py
index 52eb94afe47..ee7733f3a29 100644
--- a/Code/Mantid/docs/source/conf.py
+++ b/Code/Mantid/docs/source/conf.py
@@ -17,6 +17,8 @@ sys.path.insert(0, os.path.abspath('../sphinxext'))
 # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
 # ones.
 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',
@@ -62,6 +64,15 @@ from mantid.api import FrameworkManager
 FrameworkManager.Instance().clear()
 """
 
+# -- Options for pngmath --------------------------------------------------
+
+# Load the preview package into latex
+pngmath_latex_preamble=r'\usepackage[active]{preview}'
+
+# Ensures that the vertical alignment of equations is correct.
+# See http://sphinx-doc.org/ext/math.html#confval-pngmath_use_preview
+pngmath_use_preview = True
+
 # -- Options for HTML output ----------------------------------------------
 
 # The theme to use for HTML and HTML Help pages.  See the documentation for
-- 
GitLab