Index: .gitignore
===================================================================
--- .gitignore	(revision ecdd1329f3d08a5aa572dbfe37b8bff1e161f9d3)
+++ .gitignore	(revision e9df8a5f8d0ff47d97d92068ed122dd5f81d2285)
@@ -49,4 +49,5 @@
 /docs/sphinx-docs/source/user/perspectives
 /docs/sphinx-docs/source/user/sasgui
+/docs/sphinx-docs/katex*.zip
 
 
Index: build_tools/jenkins_linux_build.sh
===================================================================
--- build_tools/jenkins_linux_build.sh	(revision 128c2872f997a4739e0f79db0844701148e2b0a0)
+++ build_tools/jenkins_linux_build.sh	(revision 1573220ba721f0b7bddb8061b2e6ceee79d963a3)
@@ -63,4 +63,8 @@
 $PYTHON setup.py build docs bdist_egg
 
+# CREATE PDF FROM LATEX
+#cd $WORKSPACE
+#cd sasview/docs/sphinx-docs/build/latex
+#pdflatex SasView.tex
 
 # INSTALL SASVIEW
Index: docs/sphinx-docs/Makefile
===================================================================
--- docs/sphinx-docs/Makefile	(revision 1d5f5c20a9deebda81aa660ca4fd66d8695ed081)
+++ docs/sphinx-docs/Makefile	(revision 31943715d145c5ad0cc2df2ac75442591490886e)
@@ -16,5 +16,5 @@
 PAPEROPT_a4     = -D latex_paper_size=a4
 PAPEROPT_letter = -D latex_paper_size=letter
-ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source-temp
 # the i18n builder cannot share the environment and doctrees with the others
 I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
@@ -53,5 +53,5 @@
 	rm -rf source/dev/api
 	sphinx-apidoc -o source/dev/api -d 8 ../../src
-	
+
 html: stubs
 	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
Index: docs/sphinx-docs/build_sphinx.py
===================================================================
--- docs/sphinx-docs/build_sphinx.py	(revision 4abc05d8a9e1b4dd5fb5a5787df90e91af46de72)
+++ docs/sphinx-docs/build_sphinx.py	(revision 6e546f8a9b31bcb236a71a310814c6edf02cef33)
@@ -18,4 +18,6 @@
 from distutils.dir_util import copy_tree
 from distutils.util import get_platform
+from distutils.spawn import find_executable
+
 from shutil import copy
 from os import listdir
@@ -324,5 +326,4 @@
         print("!!!!NO MODEL DOCS WILL BE BUILT!!!!")
 
-
 def retrieve_bumps_docs():
     """
@@ -360,9 +361,36 @@
                      SASVIEW_BUILD])
 
+def build_pdf():
+    """
+    Runs sphinx-build for pdf.  Reads in all .rst files and spits out the final html.
+    """
+    print("=== Build PDF Docs from ReST Files ===")
+    subprocess.call(["sphinx-build",
+                     "-b", "latex", # Builder name. TODO: accept as arg to setup.py.
+                     "-d", os.path.join(SPHINX_BUILD, "doctrees"),
+                     SPHINX_SOURCE,
+                     os.path.join(SPHINX_BUILD, "latex")])
+
+    LATEXDIR = os.path.join(SPHINX_BUILD, "latex")
+    #TODO: Does it need to be done so many time?
+    def pdflatex():
+        subprocess.call(["pdflatex", "SasView.tex"], cwd=LATEXDIR)
+    pdflatex()
+    pdflatex()
+    pdflatex()
+    subprocess.call(["makeindex", "-s", "python.ist", "SasView.idx"], cwd=LATEXDIR)
+    pdflatex()
+    pdflatex()
+
+    print("=== Copy PDF to HTML Directory ===")
+    source = os.path.join(LATEXDIR, "SasView.pdf")
+    target = os.path.join(SASVIEW_DOCS, "SasView.pdf")
+    shutil.copyfile(source, target)
+
 def build():
     """
     Runs sphinx-build.  Reads in all .rst files and spits out the final html.
     """
-    print("=== Build HTML Docs from Rest Files ===")
+    print("=== Build HTML Docs from ReST Files ===")
     subprocess.call(["sphinx-build",
                      "-b", "html", # Builder name. TODO: accept as arg to setup.py.
@@ -375,4 +403,31 @@
     copy_tree(html, SASVIEW_DOCS)
 
+def fetch_katex(version, destination="_static"):
+    from zipfile import ZipFile
+    import urllib2
+    url = "https://github.com/Khan/KaTeX/releases/download/%s/katex.zip" % version
+    cache_path = "katex_%s.zip" % version
+    if not os.path.exists(cache_path):
+        try:
+            fd_in = urllib2.urlopen(url)
+            with open(cache_path, "wb") as fd_out:
+                fd_out.write(fd_in.read())
+        finally:
+            fd_in.close()
+    with ZipFile(cache_path) as zip:
+        zip.extractall(destination)
+
+def convert_katex():
+    print("=== Preprocess HTML, converting latex to html ===")
+    subprocess.call(["node", "convertKaTex.js", SASVIEW_DOCS])
+
+def convert_mathjax():
+    print("=== Preprocess HTML, converting latex to html ===")
+    subprocess.call(["node", "convertMathJax.js", SASVIEW_DOCS])
+
+def fetch_mathjax():
+    subprocess.call(["npm", "install", "mathjax-node-page"])
+    # TODO: copy fonts from node_modules/mathjax/fonts/HTML-CSS/Tex into static
+
 def rebuild():
     clean()
@@ -380,6 +435,12 @@
     retrieve_user_docs()
     retrieve_bumps_docs()
+    #fetch_katex(version=KATEX_VERSION, destination=KATEX_PARENT)
+    #fetch_mathjax()
     apidoc()
     build()
+    if find_executable('latex'):
+        build_pdf()
+    #convert_katex()
+    #convert_mathjax()
 
     print("=== Done ===")
Index: docs/sphinx-docs/convertKaTex.js
===================================================================
--- docs/sphinx-docs/convertKaTex.js	(revision a6866175d29c777798ccfbb4502a17013b9c48c1)
+++ docs/sphinx-docs/convertKaTex.js	(revision a6866175d29c777798ccfbb4502a17013b9c48c1)
@@ -0,0 +1,87 @@
+#!/usr/bin/env node
+// Usage:
+//    npm install jsdom
+//    node convertTree.js build/html
+/* eslint no-console:0 */
+/* global katex */
+"use strict";
+
+/**
+ * Set a global variables name to value.
+ */
+function setGlobal(name, value) {
+    (function(globals) { globals[name] = value; }((1, eval)('this')));
+}
+
+const fs = require("fs");  // standard node
+const jsdom = require("jsdom");  // npm install jsdom
+const { JSDOM } = jsdom;
+
+// Need a fake document in order to initialize katex, and it needs to be strict
+const DTD = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
+const empty_dom = new JSDOM(DTD+'\n<html><body></body></html>');
+setGlobal('document', empty_dom.window.document);
+
+const path = require("path");
+setGlobal('katex', require(path.resolve("./build/html/_static/katex/katex.min")));
+const renderMathInElement = require(path.resolve("./build/html/_static/katex/contrib/auto-render.min"));
+//setGlobal('katex', require("../../katex.js"));
+//const renderMathInElement = require("../auto-render/auto-render");
+
+function isDir(path) {
+    const stat = fs.statSync(path);
+    return (stat && stat.isDirectory());
+}
+
+/**
+ * Walk a directory tree, yielding a list of matching filenames
+ *
+ * @param {path} dir - root of the tree which is walked
+ * @param {regex} [pattern] - regular expression match for the full path
+ */
+function* walkit(dir, pattern = /./) {
+    const _walk = function* (dir) {
+        const entries = fs.readdirSync(dir);
+        for (const entry of entries) {
+            const path = dir + "/" + entry;
+            if (isDir(path)) {
+                //console.log('walking '+path);
+                yield* _walk(path);
+            } else if (pattern.test(path)) {
+                //console.log('yielding '+path);
+                yield path;
+            }
+        }
+    };
+    yield* _walk(dir);
+}
+
+function processHtml(path) {
+    JSDOM.fromFile(path).then(dom => {
+        console.log("====> processing", path);
+        //console.log(dom.serialize());
+        setGlobal('document', dom.window.document);
+        //console.log(document.compatMode);
+        renderMathInElement(dom.window.document.body);
+        //console.log(dom.serialize());
+        fs.writeFileSync(path, dom.serialize());
+    }).catch(console.log.bind(console));
+}
+
+function processTree(dir) {
+    //console.log(process.argv.slice(2));
+    for (const path of walkit(dir, /\.html$/)) {
+        processHtml(path);
+    }
+}
+
+if (typeof require !== 'undefined' && require.main === module) {
+    //console.log(process.argv.slice(2));
+    for (const arg of process.argv.slice(2)) {
+        if (isDir(arg)) {
+            processTree(arg);
+        } else if (/\.html$/.test(arg)) {
+            processHtml(arg);
+        }
+    }
+}
Index: docs/sphinx-docs/convertMathJax.js
===================================================================
--- docs/sphinx-docs/convertMathJax.js	(revision 35ddae56eb0449a0d89239d0152f73017ed8fc1e)
+++ docs/sphinx-docs/convertMathJax.js	(revision 35ddae56eb0449a0d89239d0152f73017ed8fc1e)
@@ -0,0 +1,168 @@
+#!/usr/bin/env node
+// Usage:
+//    npm install jsdom
+//    node convertTree.js build/html
+/* eslint no-console:0 */
+/* global katex */
+"use strict";
+
+/**
+ * Set a global variables name to value.
+ */
+function setGlobal(name, value) {
+    (function(globals) { globals[name] = value; }((1, eval)('this')));
+}
+
+const fs = require("fs");
+//const await = require("await");
+const mjpage = require('mathjax-node-page').mjpage;
+
+function isDir(path) {
+    const stat = fs.statSync(path);
+    return (stat && stat.isDirectory());
+}
+
+/**
+ * Walk a directory tree, yielding a list of matching filenames
+ *
+ * @param {path} dir - root of the tree which is walked
+ * @param {regex} [pattern] - regular expression match for the full path
+ */
+function* walkit(dir, pattern = /./) {
+    const _walk = function* (dir) {
+        const entries = fs.readdirSync(dir);
+        for (const entry of entries) {
+            const path = dir + "/" + entry;
+            if (isDir(path)) {
+                //console.log('walking '+path);
+                yield* _walk(path);
+            } else if (pattern.test(path)) {
+                //console.log('yielding '+path);
+                yield path;
+            }
+        }
+    };
+    yield* _walk(dir);
+}
+
+function readFileAsync(path) {
+    return new Promise((resolve, reject) =>
+        fs.readFile(path, (err, data) => {
+            if (err) { reject(err); } else { resolve(data); }
+        }));
+}
+
+function writeFileAsync(path, data) {
+    return new Promise((resolve, reject) =>
+        fs.writeFile(path, data, (err) => {
+            if (err) { reject(err); } else { resolve(data); }
+        }));
+}
+
+const pageConfig = {
+    format: ["TeX"],
+    //output: 'html',
+    output: 'svg',
+    fontURL: 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js/fonts/HTML-CSS',
+    MathJax: {
+            //config: ["MMLorHTML.js"],
+            //jax: ["input/TeX","input/MathML","output/HTML-CSS",
+            //      "output/NativeMML", "output/PreviewHTML"],
+            jax: ["input/TeX", "output/HTML-CSS"],
+            //extensions: ["tex2jax.js","mml2jax.js","MathMenu.js",
+            //             "MathZoom.js", "fast-preview.js",
+            //             "AssistiveMML.js", "a11y/accessibility-menu.js"
+            //            ],
+            extensions: ["tex2jax.js"],
+            TeX: {
+                extensions: ["AMSmath.js","AMSsymbols.js",
+                             "noErrors.js","noUndefined.js"]
+            }
+    }
+}
+const mjnodeConfig = {
+  ex: 6, // ex-size in pixels
+  width: 100, // width of math container (in ex) for linebreaking and tags
+  fragment: false,
+  useFontCache: true, // use <defs> and <use> in svg output?
+  useGlobalCache: false, // use common <defs> for all equations?
+  //state: mjstate, // track global state
+  linebreaks: false, // do linebreaking?
+  equationNumbers: "none", // or "AMS" or "all"
+  //math: "", // the math to typeset
+  html: true, // generate HTML output?
+  css: true, // generate CSS for HTML output?
+  //mml: false, // generate mml output?
+  //svg: false, // generate svg output?
+  //speakText: true, // add spoken annotations to output?
+  //timeout: 10 * 1000, // 10 second timeout before restarting MathJax
+}
+function mjpageAsync(input, pageConfig, mjnodeConfig) {
+    return new Promise((resolve, reject) =>
+        mjpage(input, pageConfig, mjnodeConfig, output => resolve(output))
+    );
+}
+async function updateHtmlAsync(path) {
+  try {
+    console.log("====> processing", path);
+    const input = await readFileAsync(path);
+    const output = await mjpageAsync(input, pageConfig, mjnodeConfig);
+    return await writeFileAsync(path, output);
+  } catch (err) {
+    console.log(err);
+  }
+}
+
+async function processTreeAsync(dir) {
+    //console.log(dir);
+    for (const path of walkit(dir, /\.html$/)) {
+        await updateHtmlAsync(path);
+    }
+}
+
+async function mainAsync(args) {
+    //console.log(process.argv.slice(2));
+    for (const arg of args) {
+        if (isDir(arg)) {
+            processTreeAsync(arg);
+        } else if (/\.html$/.test(arg)) {
+            updateHtmlAsync(arg);
+        }
+    }
+}
+
+
+function updateHtmlSortOfSync(path) {
+    console.log("====> loading", path);
+    const input = fs.readFileSync(path);
+    //const pageConfig = {format: ['TeX']}
+    //const mjnodeConfig = {html: true}
+    mjpage(input, pageConfig, mjnodeConfig,
+            //output => console.log(output));
+            output => {
+                console.log("====> processed", path);
+                fs.writeFileSync(path, output)
+            });
+}
+
+function processTreeSortOfSync(dir) {
+    //console.log(dir);
+    for (const path of walkit(dir, /\.html$/)) {
+        updateHtmlSortOfSync(path);
+    }
+}
+
+function mainSortOfSync(args) {
+    //console.log(process.argv.slice(2));
+    for (const arg of args) {
+        if (isDir(arg)) {
+            processTreeSortOfSync(arg);
+        } else if (/\.html$/.test(arg)) {
+            updateHtmlSortOfSync(arg);
+        }
+    }
+}
+
+if (typeof require !== 'undefined' && require.main === module) {
+    console.log(mainAsync(process.argv.slice(2)));
+}
Index: docs/sphinx-docs/source/_extensions/mathjax.py
===================================================================
--- docs/sphinx-docs/source/_extensions/mathjax.py	(revision f477159602807c5dfc0a1ec9bd2b3f438185ddc3)
+++ docs/sphinx-docs/source/_extensions/mathjax.py	(revision f477159602807c5dfc0a1ec9bd2b3f438185ddc3)
@@ -0,0 +1,117 @@
+# -*- coding: utf-8 -*-
+"""
+    sphinx.ext.mathjax
+    ~~~~~~~~~~~~~~~~~~
+
+    Allow `MathJax <http://mathjax.org/>`_ to be used to display math in
+    Sphinx's HTML writer -- requires the MathJax JavaScript library on your
+    webserver/computer.
+
+    :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS.
+    :license: BSD, see LICENSE for details.
+
+    sample lines in conf.py to use this::
+
+        mathjax_path = ['https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.js',
+                        'http://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/contrib/auto-render.min.js',
+                        'rendermath.js']
+        mathjax_css = 'https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.6.0/katex.min.css'
+
+    with rendermath.js containing::
+
+        document.addEventListener("DOMContentLoaded", function(event) {
+            renderMathInElement(document.body);
+        });
+
+    2016-08-09 Jason Sachs
+    * allow list of URLS for mathjax_path, which permits use of katex.js
+"""
+
+from docutils import nodes
+
+import sphinx
+from sphinx.locale import _
+from sphinx.errors import ExtensionError
+from sphinx.ext.mathbase import setup_math as mathbase_setup
+
+
+def html_visit_math(self, node):
+    self.body.append(self.starttag(node, 'span', '', CLASS='math'))
+    self.body.append(self.builder.config.mathjax_inline[0] +
+                     self.encode(node['latex']) +
+                     self.builder.config.mathjax_inline[1] + '</span>')
+    raise nodes.SkipNode
+
+
+def html_visit_displaymath(self, node):
+    self.body.append(self.starttag(node, 'div', CLASS='math'))
+    if node['nowrap']:
+        self.body.append(self.encode(node['latex']))
+        self.body.append('</div>')
+        raise nodes.SkipNode
+
+    # necessary to e.g. set the id property correctly
+    if node['number']:
+        self.body.append('<span class="eqno">(%s)' % node['number'])
+        self.add_permalink_ref(node, _('Permalink to this equation'))
+        self.body.append('</span>')
+    self.body.append(self.builder.config.mathjax_display[0])
+    parts = [prt for prt in node['latex'].split('\n\n') if prt.strip()]
+    if len(parts) > 1:  # Add alignment if there are more than 1 equation
+        self.body.append(r' \begin{align}\begin{aligned}')
+    for i, part in enumerate(parts):
+        part = self.encode(part)
+        if r'\\' in part:
+            self.body.append(r'\begin{split}' + part + r'\end{split}')
+        else:
+            self.body.append(part)
+        if i < len(parts) - 1:  # append new line if not the last equation
+            self.body.append(r'\\')
+    if len(parts) > 1:  # Add alignment if there are more than 1 equation
+        self.body.append(r'\end{aligned}\end{align} ')
+    self.body.append(self.builder.config.mathjax_display[1])
+    self.body.append('</div>\n')
+    raise nodes.SkipNode
+
+try:
+    basestring
+except:
+    basestring = str
+
+def builder_inited(app):
+    jaxpath = app.config.mathjax_path
+    if not jaxpath:
+        raise ExtensionError('mathjax_path config value must be set for the '
+                             'mathjax extension to work')
+
+    # app.config.mathjax_path can be a string or a list of strings
+    if isinstance(jaxpath, basestring):
+        app.add_javascript(jaxpath)
+    else:
+        for p in jaxpath:
+            app.add_javascript(p)
+
+    if app.config.mathjax_css:
+        app.add_stylesheet(app.config.mathjax_css)
+
+
+def setup(app):
+    try:
+        mathbase_setup(app, (html_visit_math, None), (html_visit_displaymath, None))
+    except ExtensionError:
+        raise ExtensionError('sphinx.ext.mathjax: other math package is already loaded')
+
+    # more information for mathjax secure url is here:
+    # http://docs.mathjax.org/en/latest/start.html#secure-access-to-the-cdn
+    app.add_config_value('mathjax_path',
+                         'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?'
+                         'config=TeX-MML-AM_CHTML',
+                         #'config=TeX-AMS-MML_HTMLorMML',
+                         False)
+    app.add_config_value('mathjax_css', None, 'html')
+    app.add_config_value('mathjax_use_katex', False, 'html')
+    app.add_config_value('mathjax_inline', [r'\(', r'\)'], 'html')
+    app.add_config_value('mathjax_display', [r'\[', r'\]'], 'html')
+    app.connect('builder-inited', builder_inited)
+
+    return {'version': sphinx.__display_version__, 'parallel_read_safe': True}
Index: docs/sphinx-docs/source/_static/rendermath.js
===================================================================
--- docs/sphinx-docs/source/_static/rendermath.js	(revision afca48850c5f8018d72eb8d0b9c040637c7eb3bf)
+++ docs/sphinx-docs/source/_static/rendermath.js	(revision afca48850c5f8018d72eb8d0b9c040637c7eb3bf)
@@ -0,0 +1,4 @@
+// Render katex on page.
+document.addEventListener("DOMContentLoaded", function(event) {
+	    renderMathInElement(document.body);
+});
Index: docs/sphinx-docs/source/conf.py
===================================================================
--- docs/sphinx-docs/source/conf.py	(revision 6394851e9ff662a22e84b744274580762e427d72)
+++ docs/sphinx-docs/source/conf.py	(revision 96f00a07b39c62612fd3684bbda73ec207e92b64)
@@ -36,9 +36,24 @@
               'sphinx.ext.coverage',
               'sphinx.ext.mathjax',
+              #'mathjax',  # replacement mathjax that allows a list of paths
               'dollarmath',
               'sphinx.ext.viewcode']
 
-#set mathjax path
-mathjax_path="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML"
+mathjax_path = (
+    'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?'
+    'config=TeX-MML-AM_CHTML')
+
+# For katex uncomment the following
+"""
+#STATIC_PATH = '../../_static/'
+STATIC_PATH = ''
+mathjax_path = [
+    STATIC_PATH + 'katex/katex.min.js',
+    STATIC_PATH + 'katex/contrib/auto-render.min.js',
+    STATIC_PATH + 'rendermath.js'
+]
+mathjax_css = STATIC_PATH + 'katex/katex.min.css'
+"""
+
 
 # Add any paths that contain templates here, relative to this directory.
@@ -204,10 +219,13 @@
 # -- Options for LaTeX output --------------------------------------------------
 
+# TODO: seems like angstroms is defined twice.
 LATEX_PREAMBLE=r"""
+\usepackage[utf8]{inputenc}      % Allow unicode symbols in text
+\newcommand{\lt}{<}              % HTML needs \lt rather than <
+\newcommand{\gt}{>}              % HTML needs \gt rather than >
 \renewcommand{\AA}{\text{\r{A}}} % Allow \AA in math mode
-\usepackage[utf8]{inputenc}      % Allow unicode symbols in text
+\DeclareUnicodeCharacter {212B} {\AA}                  % Angstrom
 \DeclareUnicodeCharacter {00B7} {\ensuremath{\cdot}}   % cdot
 \DeclareUnicodeCharacter {00B0} {\ensuremath{^\circ}}  % degrees
-\DeclareUnicodeCharacter {212B} {\AA}                  % Angstrom
 """
 latex_elements = {
Index: docs/sphinx-docs/source/rst_prolog
===================================================================
--- docs/sphinx-docs/source/rst_prolog	(revision a45185c94fc8e2fba8f29e95bece8cce451fe5aa)
+++ docs/sphinx-docs/source/rst_prolog	(revision 1659f54b83a4ef1858ffda40170e4ea6d4e03ca9)
@@ -1,45 +1,4 @@
 .. Set up some substitutions to make life easier...
-.. Remove |biggamma|, etc. when they are no longer needed.
 
-
-.. |alpha| unicode:: U+03B1
-.. |beta| unicode:: U+03B2
-.. |gamma| unicode:: U+03B3
-.. |delta| unicode:: U+03B4
-.. |epsilon| unicode:: U+03B5
-.. |zeta| unicode:: U+03B6
-.. |eta| unicode:: U+03B7
-.. |theta| unicode:: U+03B8
-.. |iota| unicode:: U+03B9
-.. |kappa| unicode:: U+03BA
-.. |lambda| unicode:: U+03BB
-.. |mu| unicode:: U+03BC
-.. |nu| unicode:: U+03BD
-.. |xi| unicode:: U+03BE
-.. |omicron| unicode:: U+03BF
-.. |pi| unicode:: U+03C0
-.. |rho| unicode:: U+03C1
-.. |sigma| unicode:: U+03C3
-.. |tau| unicode:: U+03C4
-.. |upsilon| unicode:: U+03C5
-.. |phi| unicode:: U+03C6
-.. |chi| unicode:: U+03C7
-.. |psi| unicode:: U+03C8
-.. |omega| unicode:: U+03C9
-
-
-.. |biggamma| unicode:: U+0393
-.. |bigdelta| unicode:: U+0394
-.. |bigzeta| unicode:: U+039E
-.. |bigpsi| unicode:: U+03A8
-.. |bigphi| unicode:: U+03A6
-.. |bigsigma| unicode:: U+03A3
-.. |Gamma| unicode:: U+0393
-.. |Delta| unicode:: U+0394
-.. |Zeta| unicode:: U+039E
-.. |Psi| unicode:: U+03A8
-
-
-.. |drho| replace:: |Delta|\ |rho|
 .. |Ang| unicode:: U+212B
 .. |Ang^-1| replace:: |Ang|\ :sup:`-1`
@@ -57,12 +16,4 @@
 .. |cm^-3| replace:: cm\ :sup:`-3`
 .. |sr^-1| replace:: sr\ :sup:`-1`
-.. |P0| replace:: P\ :sub:`0`\
-.. |A2| replace:: A\ :sub:`2`\
-
-
-.. |equiv| unicode:: U+2261
-.. |noteql| unicode:: U+2260
-.. |TM| unicode:: U+2122
-
 
 .. |cdot| unicode:: U+00B7
Index: src/sas/sascalc/calculator/sas_gen.py
===================================================================
--- src/sas/sascalc/calculator/sas_gen.py	(revision a1b8fee73528559155793dd74cda07d0c32e9d72)
+++ src/sas/sascalc/calculator/sas_gen.py	(revision a1b8fee73528559155793dd74cda07d0c32e9d72)
@@ -913,6 +913,6 @@
     def set_sldms(self, sld_mx, sld_my, sld_mz):
         r"""
-        Sets (\|m\|, m_theta, m_phi)
-        """
+        Sets mx, my, mz and abs(m).
+        """ # Note: escaping
         if sld_mx.__class__.__name__ == 'float':
             self.sld_mx = np.ones(len(self.pos_x)) * sld_mx
Index: src/sas/sascalc/realspace/__init__.py
===================================================================
--- src/sas/sascalc/realspace/__init__.py	(revision 959eb0181ad06828a748f04512f953aad5b31659)
+++ src/sas/sascalc/realspace/__init__.py	(revision 959eb0181ad06828a748f04512f953aad5b31659)
@@ -1,12 +1,12 @@
 """
     Real-Space Modeling for SAS
-""" 
+"""
 ## \mainpage Real-Space Modeling for SAS
 #
 # \section intro_sec Introduction
-# This module provides SAS scattering intensity simulation 
+# This module provides SAS scattering intensity simulation
 # based on real-space modeling.
 #
-# Documentation can be found here: 
+# Documentation can be found here:
 #    http://danse.us/trac/sas/wiki/RealSpaceModeling
 #
@@ -37,10 +37,10 @@
 #
 # \section overview_sec Package Overview
-# 
+#
 # \subsection class Class Diagram:
 # \image html real-space-class-diagram.png
 #
 # \subsection behav Behavior Enumeration:
-# \image html enum.gif
+# \image html enum.png
 #
 # \subsection Tutorial
@@ -78,3 +78,2 @@
 # \section help_sec Contact Info
 # Code and Documentation by Jing Zhou as part of the DANSE project.
-
Index: src/sas/sasgui/guiframe/aboutbox.py
===================================================================
--- src/sas/sasgui/guiframe/aboutbox.py	(revision 959eb0181ad06828a748f04512f953aad5b31659)
+++ src/sas/sasgui/guiframe/aboutbox.py	(revision 959eb0181ad06828a748f04512f953aad5b31659)
@@ -31,10 +31,10 @@
       (os.path.isfile("%s/%s.pyc" % (path, 'local_config'))):
         fObj, path, descr = imp.find_module('local_config', [path])
-        config = imp.load_module('local_config', fObj, path, descr)  
+        config = imp.load_module('local_config', fObj, path, descr)
     else:
         # Try simply importing local_config
         import local_config as config
 except:
-    # Didn't find local config, load the default 
+    # Didn't find local config, load the default
     import config
 
@@ -42,9 +42,9 @@
     """
     Launches browser and opens specified url
-    
+
     In some cases may require BROWSER environment variable to be set up.
-    
+
     :param url: URL to open
-    
+
     """
     import webbrowser
@@ -55,10 +55,10 @@
     """
     "About" Dialog
-    
+
     Shows product name, current version, authors, and link to the product page.
     Current version is taken from version.py
-    
-    """
-    
+
+    """
+
     def __init__(self, *args, **kwds):
 
@@ -66,11 +66,11 @@
         kwds["style"] = wx.DEFAULT_DIALOG_STYLE
         wx.Dialog.__init__(self, *args, **kwds)
-        
+
         file_dir = os.path.dirname(__file__)
-        
+
         # Mac doesn't display images with transparent background so well,
         # keep it for Windows
         image = file_dir + "/images/angles_flat.png"
-        
+
         if os.path.isfile(config._corner_image):
             image = config._corner_image
@@ -80,5 +80,5 @@
         else:
             self.bitmap_logo = wx.StaticBitmap(self, -1, wx.Bitmap(image))
-        
+
         self.label_title = wx.StaticText(self, -1, config.__appname__)
         self.label_version = wx.StaticText(self, -1, "")
@@ -112,5 +112,5 @@
         #self.bitmap_button_danse = wx.BitmapButton(self, -1, wx.NullBitmap)
         self.bitmap_button_msu = wx.BitmapButton(self, -1, wx.NullBitmap)
-        
+
         self.bitmap_button_isis = wx.BitmapButton(self, -1, wx.NullBitmap)
         self.bitmap_button_ess = wx.BitmapButton(self, -1, wx.NullBitmap)
@@ -119,5 +119,5 @@
         self.bitmap_button_tudelft = wx.BitmapButton(self, -1, wx.NullBitmap)
         self.bitmap_button_dls = wx.BitmapButton(self, -1, wx.NullBitmap)
-        
+
         self.static_line_3 = wx.StaticLine(self, -1)
         self.button_OK = wx.Button(self, wx.ID_OK, "OK")
@@ -125,5 +125,5 @@
         self.__set_properties()
         self.__do_layout()
-        
+
         self.Bind(wx.EVT_BUTTON, self.onNistLogo, self.bitmap_button_nist)
         self.Bind(wx.EVT_BUTTON, self.onUmdLogo, self.bitmap_button_umd)
@@ -145,5 +145,5 @@
         random.shuffle(config._authors)
         strLabel = ", ".join(config._authors)
-        
+
         # display version and svn revison numbers
         verwords = config.__version__.split('.')
@@ -157,16 +157,16 @@
         self.label_version.SetLabel(config.__version__)#(version)
         self.label_svnrevision.SetLabel(build_num)
-        
+
         # set bitmaps for logo buttons
         image = file_dir + "/images/nist_logo.png"
         if os.path.isfile(config._nist_logo):
             image = config._nist_logo
-        logo = wx.Bitmap(image)        
+        logo = wx.Bitmap(image)
         self.bitmap_button_nist.SetBitmapLabel(logo)
-        
+
         image = file_dir + "/images/umd_logo.png"
         if os.path.isfile(config._umd_logo):
             image = config._umd_logo
-        logo = wx.Bitmap(image)        
+        logo = wx.Bitmap(image)
         self.bitmap_button_umd.SetBitmapLabel(logo)
 
@@ -174,5 +174,5 @@
         if os.path.isfile(config._ornl_logo):
             image = config._ornl_logo
-        logo = wx.Bitmap(image)        
+        logo = wx.Bitmap(image)
         self.bitmap_button_ornl.SetBitmapLabel(logo)
 
@@ -181,11 +181,11 @@
         if os.path.isfile(config._sns_logo):
             image = config._sns_logo
-        logo = wx.Bitmap(image)        
+        logo = wx.Bitmap(image)
         self.bitmap_button_sns.SetBitmapLabel(logo)
-        
+
         image = file_dir + "/images/nsf_logo.png"
         if os.path.isfile(config._nsf_logo):
             image = config._nsf_logo
-        logo = wx.Bitmap(image)        
+        logo = wx.Bitmap(image)
         self.bitmap_button_nsf.SetBitmapLabel(logo)
 
@@ -196,14 +196,14 @@
         self.bitmap_button_danse.SetBitmapLabel(logo)
         """
-        image = file_dir + "/images/utlogo.gif"
+        image = file_dir + "/images/utlogo.png"
         if os.path.isfile(config._inst_logo):
             image = config._inst_logo
         logo = wx.Bitmap(image)
         self.bitmap_button_msu.SetBitmapLabel(logo)
-        
+
         image = file_dir + "/images/isis_logo.png"
         if os.path.isfile(config._isis_logo):
             image = config._isis_logo
-        logo = wx.Bitmap(image)        
+        logo = wx.Bitmap(image)
         self.bitmap_button_isis.SetBitmapLabel(logo)
 
@@ -213,5 +213,5 @@
         logo = wx.Bitmap(image)
         self.bitmap_button_ess.SetBitmapLabel(logo)
-        
+
         image = file_dir + "/images/ill_logo.png"
         if os.path.isfile(config._ill_logo):
@@ -219,5 +219,5 @@
         logo = wx.Bitmap(image)
         self.bitmap_button_ill.SetBitmapLabel(logo)
-        
+
         image = file_dir + "/images/ansto_logo.png"
         if os.path.isfile(config._ansto_logo):
@@ -225,5 +225,5 @@
         logo = wx.Bitmap(image)
         self.bitmap_button_ansto.SetBitmapLabel(logo)
-        
+
         image = file_dir + "/images/tudelft_logo.png"
         if os.path.isfile(config._tudelft_logo):
@@ -231,5 +231,5 @@
         logo = wx.Bitmap(image)
         self.bitmap_button_tudelft.SetBitmapLabel(logo)
-        
+
         image = file_dir + "/images/dls_logo.png"
         if os.path.isfile(config._dls_logo):
@@ -237,5 +237,5 @@
         logo = wx.Bitmap(image)
         self.bitmap_button_dls.SetBitmapLabel(logo)
-                
+
         # resize dialog window to fit version number nicely
         if wx.VERSION >= (2, 7, 2, 0):
@@ -244,5 +244,5 @@
             size = [self.GetBestFittingSize()[0], self.GetSize()[1]]
         self.Fit()
-        
+
     def __set_properties(self):
         """
@@ -310,36 +310,36 @@
         sizer_main.Add(self.static_line_2, 0, wx.EXPAND, 0)
 
-        sizer_logos.Add(self.bitmap_button_msu, 0, 
+        sizer_logos.Add(self.bitmap_button_msu, 0,
                         wx.LEFT|wx.ADJUST_MINSIZE, 2)
         #sizer_logos.Add(self.bitmap_button_danse, 0,
         #                wx.LEFT|wx.ADJUST_MINSIZE, 2)
-        #sizer_logos.Add(self.bitmap_button_nsf, 0, 
+        #sizer_logos.Add(self.bitmap_button_nsf, 0,
         #                wx.LEFT|wx.ADJUST_MINSIZE, 2)
-        sizer_logos.Add(self.bitmap_button_umd, 0, 
-                        wx.LEFT|wx.ADJUST_MINSIZE, 2)
-        sizer_logos.Add(self.bitmap_button_nist, 0, 
-                        wx.LEFT|wx.ADJUST_MINSIZE, 2)
-        #sizer_logos.Add(self.bitmap_button_sns, 0, 
+        sizer_logos.Add(self.bitmap_button_umd, 0,
+                        wx.LEFT|wx.ADJUST_MINSIZE, 2)
+        sizer_logos.Add(self.bitmap_button_nist, 0,
+                        wx.LEFT|wx.ADJUST_MINSIZE, 2)
+        #sizer_logos.Add(self.bitmap_button_sns, 0,
         #                wx.LEFT|wx.ADJUST_MINSIZE, 2)
-        sizer_logos.Add(self.bitmap_button_ornl, 0, 
-                        wx.LEFT|wx.ADJUST_MINSIZE, 2)
-        sizer_logos.Add(self.bitmap_button_isis, 0, 
-                        wx.LEFT|wx.ADJUST_MINSIZE, 2)
-        sizer_logos.Add(self.bitmap_button_ess, 0, 
-                        wx.LEFT|wx.ADJUST_MINSIZE, 2)
-        sizer_logos.Add(self.bitmap_button_ill, 0, 
-                        wx.LEFT|wx.ADJUST_MINSIZE, 2)
-        sizer_logos.Add(self.bitmap_button_ansto, 0, 
-                        wx.LEFT|wx.ADJUST_MINSIZE, 2)
-        sizer_logos.Add(self.bitmap_button_tudelft, 0, 
-                        wx.LEFT|wx.ADJUST_MINSIZE, 2)
-        sizer_logos.Add(self.bitmap_button_dls, 0, 
-                        wx.LEFT|wx.ADJUST_MINSIZE, 2)
-                
+        sizer_logos.Add(self.bitmap_button_ornl, 0,
+                        wx.LEFT|wx.ADJUST_MINSIZE, 2)
+        sizer_logos.Add(self.bitmap_button_isis, 0,
+                        wx.LEFT|wx.ADJUST_MINSIZE, 2)
+        sizer_logos.Add(self.bitmap_button_ess, 0,
+                        wx.LEFT|wx.ADJUST_MINSIZE, 2)
+        sizer_logos.Add(self.bitmap_button_ill, 0,
+                        wx.LEFT|wx.ADJUST_MINSIZE, 2)
+        sizer_logos.Add(self.bitmap_button_ansto, 0,
+                        wx.LEFT|wx.ADJUST_MINSIZE, 2)
+        sizer_logos.Add(self.bitmap_button_tudelft, 0,
+                        wx.LEFT|wx.ADJUST_MINSIZE, 2)
+        sizer_logos.Add(self.bitmap_button_dls, 0,
+                        wx.LEFT|wx.ADJUST_MINSIZE, 2)
+
         sizer_logos.Add((10, 50), 0, wx.ADJUST_MINSIZE, 0)
         sizer_main.Add(sizer_logos, 0, wx.EXPAND, 0)
         sizer_main.Add(self.static_line_3, 0, wx.EXPAND, 0)
         sizer_button.Add((20, 40), 1, wx.EXPAND|wx.ADJUST_MINSIZE, 0)
-        sizer_button.Add(self.button_OK, 0, 
+        sizer_button.Add(self.button_OK, 0,
                          wx.RIGHT|wx.ADJUST_MINSIZE|wx.CENTER, 10)
         sizer_main.Add(sizer_button, 0, wx.EXPAND, 0)
@@ -350,5 +350,5 @@
         # end wxGlade
 
-    def onNistLogo(self, event): 
+    def onNistLogo(self, event):
         """
         """
@@ -356,6 +356,6 @@
         launchBrowser(config._nist_url)
         event.Skip()
-        
-    def onUmdLogo(self, event): 
+
+    def onUmdLogo(self, event):
         """
         """
@@ -363,6 +363,6 @@
         launchBrowser(config._umd_url)
         event.Skip()
-        
-    def onOrnlLogo(self, event): 
+
+    def onOrnlLogo(self, event):
         """
         """
@@ -370,6 +370,6 @@
         launchBrowser(config._ornl_url)
         event.Skip()
-        
-    def onSnsLogo(self, event): 
+
+    def onSnsLogo(self, event):
         """
         """
@@ -377,6 +377,6 @@
         launchBrowser(config._sns_url)
         event.Skip()
-                
-    def onNsfLogo(self, event): 
+
+    def onNsfLogo(self, event):
         """
         """
@@ -394,10 +394,10 @@
     def onUTLogo(self, event):
         """
-        """ 
+        """
         # wxGlade: DialogAbout.<event_handler>
         launchBrowser(config._inst_url)
         event.Skip()
 
-    def onIsisLogo(self, event): 
+    def onIsisLogo(self, event):
         """
         """
@@ -415,5 +415,5 @@
     def onIllLogo(self, event):
         """
-        """ 
+        """
         # wxGlade: DialogAbout.<event_handler>
         launchBrowser(config._ill_url)
@@ -422,5 +422,5 @@
     def onAnstoLogo(self, event):
         """
-        """ 
+        """
         # wxGlade: DialogAbout.<event_handler>
         launchBrowser(config._ansto_url)
@@ -429,5 +429,5 @@
     def onTudelftLogo(self, event):
         """
-        """ 
+        """
         # wxGlade: DialogAbout.<event_handler>
         launchBrowser(config._tudelft_url)
@@ -436,5 +436,5 @@
     def onDlsLogo(self, event):
         """
-        """ 
+        """
         # wxGlade: DialogAbout.<event_handler>
         launchBrowser(config._dls_url)
@@ -462,4 +462,4 @@
     app = MyApp(0)
     app.MainLoop()
-    
-##### end of testing code #####################################################    
+
+##### end of testing code #####################################################
Index: src/sas/sasgui/guiframe/config.py
===================================================================
--- src/sas/sasgui/guiframe/config.py	(revision d9089328dec4c154a6bac2735e52b5e6fb3c8af2)
+++ src/sas/sasgui/guiframe/config.py	(revision d9089328dec4c154a6bac2735e52b5e6fb3c8af2)
@@ -77,5 +77,5 @@
 _nsf_logo = os.path.join(icon_path, "nsf_logo.png")
 _danse_logo = os.path.join(icon_path, "danse_logo.png")
-_inst_logo = os.path.join(icon_path, "utlogo.gif")
+_inst_logo = os.path.join(icon_path, "utlogo.png")
 _nist_url = "http://www.nist.gov/"
 _umd_url = "http://www.umd.edu/"
Index: src/sas/sasgui/guiframe/documentation_window.py
===================================================================
--- src/sas/sasgui/guiframe/documentation_window.py	(revision d7ee5866aee5ca0454680f4e0503503702611c72)
+++ src/sas/sasgui/guiframe/documentation_window.py	(revision 2746eab3d2fd36206508d585c8b2ed061fabce96)
@@ -16,21 +16,46 @@
 import os
 import logging
-import wx
 import webbrowser
 import urllib
 import sys
 
+import wx
+try:
+    import wx.html2 as html
+    WX_SUPPORTS_HTML2 = True
+except ImportError:
+    WX_SUPPORTS_HTML2 = False
+
+from .gui_manager import get_app_dir
+
+# Don't use wx html renderer on windows.
+if os.name == 'nt':
+    WX_SUPPORTS_HTML2 = False
+
 logger = logging.getLogger(__name__)
 
 SPHINX_DOC_ENV = "SASVIEW_DOC_PATH"
-WX_SUPPORTS_HTML2 = True
-try:
-    import wx.html2 as html
-except:
-    WX_SUPPORTS_HTML2 = False
 
+THREAD_STARTED = False
+def start_documentation_server(doc_root, port):
+    import thread
+    global THREAD_STARTED
+    if not THREAD_STARTED:
+        thread.start_new_thread(_documentation_server, (doc_root, port))
+        THREAD_STARTED = True
 
-from gui_manager import get_app_dir
+def _documentation_server(doc_root, port):
+    from SimpleHTTPServer import SimpleHTTPRequestHandler
+    from SocketServer import TCPServer
 
+    os.chdir(doc_root)
+    httpd = TCPServer(("127.0.0.1", port), SimpleHTTPRequestHandler, bind_and_activate=False)
+    httpd.allow_reuse_address = True
+    try:
+        httpd.server_bind()
+        httpd.server_activate()
+        httpd.serve_forever()
+    finally:
+        httpd.server_close()
 
 class DocumentationWindow(wx.Frame):
@@ -70,18 +95,23 @@
         #Note added June 21, 2015     PDB
         file_path = os.path.join(docs_path, path)
-        url = "file:///" + urllib.quote(file_path, r'/\:')+ url_instruction
+        if path.startswith('http'):
+            url = path
+        elif not os.path.exists(file_path):
+            url = "index.html"
+            logger.error("Could not find Sphinx documentation at %s -- has it been built?",
+                         file_path)
+        elif False:
+            start_documentation_server(docs_path, port=7999)
+            url = "http://127.0.0.1:7999/" + path.replace('\\', '/') + url_instruction
+        else:
+            url = "file:///" + urllib.quote(file_path, r'/\:')+ url_instruction
 
-        if not os.path.exists(file_path):
-            logger.error("Could not find Sphinx documentation at %s \
-            -- has it been built?", file_path)
-        #Commenting following 5 lines, so default browser is forced
-        #This is due to CDN mathjax discontinuation of service, intenal help
-        #browser should be back with qt version
-        #Note added by Wojtek Potrzebowski, July 4th 2017
-        # elif WX_SUPPORTS_HTML2:
-        #     # Complete HTML/CSS support!
-        #     self.view = html.WebView.New(self)
-        #     self.view.LoadURL(url)
-        #     self.Show()
+        #logger.info("showing url " + url)
+        if WX_SUPPORTS_HTML2:
+            # Complete HTML/CSS support!
+            self.view = html.WebView.New(self)
+            self.view.LoadURL(url)
+            self.Bind(html.EVT_WEBVIEW_ERROR, self.OnError, self.view)
+            self.Show()
         else:
             logger.error("No html2 support, popping up a web browser")
@@ -92,10 +122,14 @@
             webbrowser.open_new_tab(url)
 
+    def OnError(self, evt):
+        logger.error("%d: %s", evt.GetInt(), evt.GetString())
+
 def main():
     """
     main loop function if running alone for testing.
     """
+    url = "index.html" if len(sys.argv) <= 1 else sys.argv[1]
     app = wx.App()
-    DocumentationWindow(None, -1, "index.html", "", "Documentation",)
+    DocumentationWindow(None, -1, url, "", "Documentation",)
     app.MainLoop()
 
Index: src/sas/sasgui/guiframe/media/graph_help.rst
===================================================================
--- src/sas/sasgui/guiframe/media/graph_help.rst	(revision f9b0c81e56a680c4cdbca2d3251ba73fc4b903cd)
+++ src/sas/sasgui/guiframe/media/graph_help.rst	(revision 5ed76f8390eac56ff5d3779fd9c454d0c8fe1dc0)
@@ -9,6 +9,6 @@
 
 SasView generates three different types of graph window: one that displays *1D data*
-(ie, I(Q) vs Q), one that displays *1D residuals* (ie, the difference between the
-experimental data and the theory at the same Q values), and *2D color maps*.
+(i.e., $I(Q)$ vs $Q$), one that displays *1D residuals* (ie, the difference between the
+experimental data and the theory at the same $Q$ values), and *2D color maps*.
 
 Graph window options
@@ -42,5 +42,5 @@
 plot window.
 
-.. note:: 
+.. note::
     *If a residuals graph (when fitting data) is hidden, it will not show up
     after computation.*
@@ -138,5 +138,5 @@
 style and size. *Remove Text* will remove the last annotation added. To change
 the legend. *Window Title* allows a custom title to be entered instead of Graph
-x. 
+x.
 
 Changing scales
@@ -226,5 +226,5 @@
 ^^^^^^^^^^^^^^^^^^^
 
-Linear fit performs a simple ( y(x)=ax+b ) linear fit within the plot window.
+Linear fit performs a simple $y(x)=ax+b$ linear fit within the plot window.
 
 In the *Dataset Menu* (see Invoking_the_dataset_menu_), select *Linear Fit*. A
@@ -234,5 +234,5 @@
 
 This option is most useful for performing simple Guinier, XS Guinier, and
-Porod type analyses, for example, to estimate Rg, a rod diameter, or incoherent
+Porod type analyses, for example, to estimate $R_g$, a rod diameter, or incoherent
 background level, respectively.
 
@@ -319,5 +319,5 @@
 ^^^^^^^^^^^^^^^^^^^^^^^^^
 
-This operation will perform an average in constant Q-rings around the (x,y)
+This operation will perform an average in constant $Q$ rings around the (x,y)
 pixel location of the beam center.
 
@@ -331,16 +331,16 @@
 ^^^^^^^^^^^^^^^^^^^^^^^
 
-This operation averages in constant Q-arcs.
-
-The width of the sector is specified in degrees (+/- |delta|\|phi|\) each side
-of the central angle (|phi|\).
-
-Annular average [|phi| View]
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-This operation performs an average between two Q-values centered on (0,0),
+This operation averages in constant $Q$ arcs.
+
+The width of the sector is specified in degrees ($\pm\delta|\phi|$) each side
+of the central angle $\phi$.
+
+Annular average [:math:`\phi`]
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This operation performs an average between two $Q$ values centered on (0,0),
 and averaged over a specified number of pixels.
 
-The data is returned as a function of angle (|phi|\) in degrees with zero
+The data is returned as a function of angle $\phi$ in degrees with zero
 degrees at the 3 O'clock position.
 
@@ -356,9 +356,9 @@
 ^^^^^^^^^^^^^^^^^^^
 
-This operation computes an average I(Qx) for the region of interest.
+This operation computes an average $I(Q_x)$ for the region of interest.
 
 When editing the slicer parameters, the user can control the length and the
 width the rectangular slicer. The averaged output is calculated from constant
-bins with rectangular shape. The resultant Q values are nominal values, that
+bins with rectangular shape. The resultant $Q$ values are nominal values, that
 is, the central value of each bin on the x-axis.
 
@@ -366,9 +366,9 @@
 ^^^^^^^^^^^^^^^^^^^
 
-This operation computes an average I(Qy) for the region of interest.
+This operation computes an average $I(Q_y)$ for the region of interest.
 
 When editing the slicer parameters, the user can control the length and the
 width the rectangular slicer. The averaged output is calculated from constant
-bins with rectangular shape. The resultant Q values are nominal values, that
+bins with rectangular shape. The resultant $Q$ values are nominal values, that
 is, the central value of each bin on the x-axis.
 
Index: src/sas/sasgui/perspectives/calculator/media/density_calculator_help.rst
===================================================================
--- src/sas/sasgui/perspectives/calculator/media/density_calculator_help.rst	(revision d85c194ea2f78cb2b9b3de9c969e1b8ebea6b6d2)
+++ src/sas/sasgui/perspectives/calculator/media/density_calculator_help.rst	(revision 6aad2e8b144e92be94b299c8ae7f4f418c094f1d)
@@ -29,5 +29,5 @@
 4) Click the 'Calculate' button to perform the calculation.
 
-.. image:: density_tutor.gif
+.. image:: density_tutor.png
 
 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
Index: src/sas/sasgui/perspectives/calculator/media/gen_sas_help.html
===================================================================
--- src/sas/sasgui/perspectives/calculator/media/gen_sas_help.html	(revision d85c194ea2f78cb2b9b3de9c969e1b8ebea6b6d2)
+++ src/sas/sasgui/perspectives/calculator/media/gen_sas_help.html	(revision 6aad2e8b144e92be94b299c8ae7f4f418c094f1d)
@@ -19,5 +19,5 @@
 by the particle 
 <p>
-<img src="gen_i.gif"/>
+<img src="gen_i.png"/>
 </p>
 <br>
@@ -26,5 +26,5 @@
 of the j'th pixel respectively. And the total volume
 <p>
-<img src="v_j.gif"/>
+<img src="v_j.png"/>
 </p>
 <br>
@@ -44,10 +44,10 @@
 scattering length. (Figure below).
 <p>
-<img src="mag_vector.bmp"/>
+<img src="mag_vector.png"/>
 </p>
 <br>
 The magnetic scattering length density is then
 <p>
-<img src="dm_eq.gif"/>
+<img src="dm_eq.png"/>
 </p>
 <br>
@@ -66,5 +66,5 @@
 <br>
 <p>
-<img src="gen_mag_pic.bmp"/>
+<img src="gen_mag_pic.png"/>
 </p>
 <br>
@@ -75,5 +75,5 @@
 densities , including the nuclear scattering length density (&#946; <sub>N</sub>) are given as, for non-spin-flips,
 <p>
-<img src="sld1.gif"/>
+<img src="sld1.png"/>
 </p>
 <br>
@@ -81,5 +81,5 @@
 for spin-flips,
 <p>
-<img src="sld2.gif"/>
+<img src="sld2.png"/>
 </p>
 <br>
@@ -87,17 +87,17 @@
 where
 <p>
-<img src="mxp.gif"/>
+<img src="mxp.png"/>
 </p>
 <p>
-<img src="myp.gif"/>
+<img src="myp.png"/>
 </p>
 <p>
-<img src="mzp.gif"/>
+<img src="mzp.png"/>
 </p>
 <p>
-<img src="mqx.gif"/>
+<img src="mqx.png"/>
 </p>
 <p>
-<img src="mqy.gif"/>
+<img src="mqy.png"/>
 </p>
 <br>
@@ -110,5 +110,5 @@
 <br>
 <p>
-<img src="gen_gui_help.bmp"/>
+<img src="gen_gui_help.png"/>
 </p>
 <br>
@@ -136,5 +136,5 @@
 in a 2D output, whileas the scattering calculation averaged over all the orientations uses the Debye equation providing a 1D output:
  <p>
-<img src="gen_debye_eq.gif"/>
+<img src="gen_debye_eq.png"/>
 </p>
 <br>
Index: src/sas/sasgui/perspectives/calculator/media/kiessig_calculator_help.rst
===================================================================
--- src/sas/sasgui/perspectives/calculator/media/kiessig_calculator_help.rst	(revision 780545820bf596bf3709c434f3eb26bcc29a1236)
+++ src/sas/sasgui/perspectives/calculator/media/kiessig_calculator_help.rst	(revision 5ed76f8390eac56ff5d3779fd9c454d0c8fe1dc0)
@@ -10,10 +10,15 @@
 -----------
 
-This tool is approximately estimates the thickness of a layer or the diameter 
-of particles from the position of the Kiessig fringe/Bragg peak in NR/SAS data 
-using the relation
+This tool estimates real space dimensions from the position or spacing of
+features in recipricol space.  In particular a particle of size $d$ will
+give rise to Bragg peaks with spacing $\Delta q$ according to the relation
 
-(thickness *or* size) = 2 * |pi| / (fringe_width *or* peak position)
-  
+.. math::
+
+    d = 2\pi / \Delta q
+
+Similarly, the spacing between the peaks in Kiessig fringes in reflectometry
+data arise from layers of thickness $d$.
+
 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
 
@@ -21,9 +26,8 @@
 --------------
 
-To get a rough thickness or particle size, simply type the fringe or peak 
+To get a rough thickness or particle size, simply type the fringe or peak
 position (in units of 1/|Ang|\) and click on the *Compute* button.
 
 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
 
-.. note::  This help document was last changed by Steve King, 01May2015
-
+.. note::  This help document was last changed by Paul Kienzle, 05Apr2017
Index: src/sas/sasgui/perspectives/calculator/media/resolution_calculator_help.rst
===================================================================
--- src/sas/sasgui/perspectives/calculator/media/resolution_calculator_help.rst	(revision 780545820bf596bf3709c434f3eb26bcc29a1236)
+++ src/sas/sasgui/perspectives/calculator/media/resolution_calculator_help.rst	(revision 5ed76f8390eac56ff5d3779fd9c454d0c8fe1dc0)
@@ -10,6 +10,6 @@
 -----------
 
-This tool is approximately estimates the resolution of Q from SAS instrumental 
-parameter values assuming that the detector is flat and normal to the 
+This tool is approximately estimates the resolution of $Q$ from SAS instrumental
+parameter values assuming that the detector is flat and normal to the
 incident beam.
 
@@ -23,47 +23,47 @@
 2) Select the source (Neutron or Photon) and source type (Monochromatic or TOF).
 
-   *NOTE! The computational difference between the sources is only the 
+   *NOTE! The computational difference between the sources is only the
    gravitational contribution due to the mass of the particles.*
 
-3) Change the default values of the instrumental parameters as required. Be 
+3) Change the default values of the instrumental parameters as required. Be
    careful to note that distances are specified in cm!
 
-4) Enter values for the source wavelength(s), |lambda|\ , and its spread (= FWHM/|lambda|\ ).
-   
-   For monochromatic sources, the inputs are just one value. For TOF sources, 
-   the minimum and maximum values should be separated by a '-' to specify a 
+4) Enter values for the source wavelength(s), $\lambda$, and its spread (= $\text{FWHM}/\lambda$).
+
+   For monochromatic sources, the inputs are just one value. For TOF sources,
+   the minimum and maximum values should be separated by a '-' to specify a
    range.
-   
-   Optionally, the wavelength (BUT NOT of the wavelength spread) can be extended 
-   by adding '; nn' where the 'nn' specifies the number of the bins for the 
-   numerical integration. The default value is nn = 10. The same number of bins 
+
+   Optionally, the wavelength (BUT NOT of the wavelength spread) can be extended
+   by adding '; nn' where the 'nn' specifies the number of the bins for the
+   numerical integration. The default value is nn = 10. The same number of bins
    will be used for the corresponding wavelength spread.
 
-5) For TOF, the default wavelength spectrum is flat. A custom spectral 
-   distribution file (2-column text: wavelength (|Ang|\) vs Intensity) can also 
+5) For TOF, the default wavelength spectrum is flat. A custom spectral
+   distribution file (2-column text: wavelength (|Ang|\) vs Intensity) can also
    be loaded by selecting *Add new* in the combo box.
 
-6) When ready, click the *Compute* button. Depending on the computation the 
+6) When ready, click the *Compute* button. Depending on the computation the
    calculation time will vary.
 
-7) 1D and 2D dQ values will be displayed at the bottom of the panel, and a 2D 
-   resolution weight distribution (a 2D elliptical Gaussian function) will also 
-   be displayed in the plot panel even if the Q inputs are outside of the 
+7) 1D and 2D $dQ$ values will be displayed at the bottom of the panel, and a 2D
+   resolution weight distribution (a 2D elliptical Gaussian function) will also
+   be displayed in the plot panel even if the $Q$ inputs are outside of the
    detector limit (the red lines indicate the limits of the detector).
-   
-   TOF only: green lines indicate the limits of the maximum Q range accessible 
+
+   TOF only: green lines indicate the limits of the maximum $Q$ range accessible
    for the longest wavelength due to the size of the detector.
-    
-   Note that the effect from the beam block/stop is ignored, so in the small Q 
-   region near the beam block/stop 
 
-   [ie., Q < 2. |pi|\ .(beam block diameter) / (sample-to-detector distance) / |lambda|\_min] 
+   Note that the effect from the beam block/stop is ignored, so in the small $Q$
+   region near the beam block/stop
+
+   [i.e., $Q < (2 \pi \cdot \text{beam block diameter}) / (\text{sample-to-detector distance} \cdot \lambda_\text{min})$]
 
    the variance is slightly under estimated.
 
-8) A summary of the calculation is written to the SasView *Console* at the 
+8) A summary of the calculation is written to the SasView *Console* at the
    bottom of the main SasView window.
 
-.. image:: resolution_tutor.gif
+.. image:: resolution_tutor.png
 
 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
@@ -74,17 +74,17 @@
 The scattering wave transfer vector is by definition
 
-.. image:: q.gif
+.. image:: q.png
 
-In the small-angle limit, the variance of Q is to a first-order 
+In the small-angle limit, the variance of $Q$ is to a first-order
 approximation
 
-.. image:: sigma_q.gif
+.. image:: sigma_q.png
 
 The geometric and gravitational contributions can then be summarised as
 
-.. image:: sigma_table.gif
+.. image:: sigma_table.png
 
-Finally, a Gaussian function is used to describe the 2D weighting distribution 
-of the uncertainty in Q.
+Finally, a Gaussian function is used to describe the 2D weighting distribution
+of the uncertainty in $Q$.
 
 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
@@ -93,8 +93,8 @@
 ----------
 
-D.F.R. Mildner and J.M. Carpenter 
+D.F.R. Mildner and J.M. Carpenter
 *J. Appl. Cryst.* 17 (1984) 249-256
 
-D.F.R. Mildner, J.M. Carpenter and D.L. Worcester 
+D.F.R. Mildner, J.M. Carpenter and D.L. Worcester
 *J. Appl. Cryst.* 19 (1986) 311-319
 
Index: src/sas/sasgui/perspectives/calculator/media/sas_calculator_help.rst
===================================================================
--- src/sas/sasgui/perspectives/calculator/media/sas_calculator_help.rst	(revision da456fba6ab06ddec7ae847f352aff18d1d855d1)
+++ src/sas/sasgui/perspectives/calculator/media/sas_calculator_help.rst	(revision 5ed76f8390eac56ff5d3779fd9c454d0c8fe1dc0)
@@ -19,34 +19,36 @@
 ------
 
-In general, a particle with a volume *V* can be described by an ensemble 
-containing *N* 3-dimensional rectangular pixels where each pixel is much 
-smaller than *V*.
+In general, a particle with a volume $V$ can be described by an ensemble
+containing $N$ 3-dimensional rectangular pixels where each pixel is much
+smaller than $V$.
 
-Assuming that all the pixel sizes are the same, the elastic scattering 
+Assuming that all the pixel sizes are the same, the elastic scattering
 intensity from the particle is
 
-.. image:: gen_i.gif
+.. image:: gen_i.png
 
 Equation 1.
 
-where |beta|\ :sub:`j` and *r*\ :sub:`j` are the scattering length density and 
-the position of the j'th pixel respectively.
+where $\beta_j$ and $r_j$ are the scattering length density and
+the position of the $j^\text{th}$ pixel respectively.
 
-The total volume *V*
+The total volume $V$
 
-.. image:: v_j.gif
+.. math::
 
-for |beta|\ :sub:`j` |noteql|\0 where *v*\ :sub:`j` is the volume of the j'th 
-pixel (or the j'th natural atomic volume (= atomic mass / (natural molar 
+    V = \sum_j^N v_j
+
+for $\beta_j \ne 0$ where $v_j$ is the volume of the $j^\text{th}$
+pixel (or the $j^\text{th}$ natural atomic volume (= atomic mass / (natural molar
 density * Avogadro number) for the atomic structures).
 
-*V* can be corrected by users. This correction is useful especially for an 
-atomic structure (such as taken from a PDB file) to get the right normalization. 
+$V$ can be corrected by users. This correction is useful especially for an
+atomic structure (such as taken from a PDB file) to get the right normalization.
 
-*NOTE!* |beta|\ :sub:`j` *displayed in the GUI may be incorrect but this will not 
+*NOTE! $\beta_j$ displayed in the GUI may be incorrect but this will not
 affect the scattering computation if the correction of the total volume V is made.*
 
-The scattering length density (SLD) of each pixel, where the SLD is uniform, is 
-a combination of the nuclear and magnetic SLDs and depends on the spin states 
+The scattering length density (SLD) of each pixel, where the SLD is uniform, is
+a combination of the nuclear and magnetic SLDs and depends on the spin states
 of the neutrons as follows.
 
@@ -54,57 +56,57 @@
 ^^^^^^^^^^^^^^^^^^^
 
-For magnetic scattering, only the magnetization component, *M*\ :sub:`perp`\ , 
-perpendicular to the scattering vector *Q* contributes to the magnetic 
+For magnetic scattering, only the magnetization component, $M_\perp$,
+perpendicular to the scattering vector $Q$ contributes to the magnetic
 scattering length.
 
-.. image:: mag_vector.bmp
+.. image:: mag_vector.png
 
 The magnetic scattering length density is then
 
-.. image:: dm_eq.gif
+.. image:: dm_eq.png
 
-where the gyromagnetic ratio |gamma| = -1.913, |mu|\ :sub:`B` is the Bohr 
-magneton, *r*\ :sub:`0` is the classical radius of electron, and |sigma| is the 
+where the gyromagnetic ratio is $\gamma = -1.913$, $\mu_B$ is the Bohr
+magneton, $r_0$ is the classical radius of electron, and $\sigma$ is the
 Pauli spin.
 
 For a polarized neutron, the magnetic scattering is depending on the spin states.
 
-Let us consider that the incident neutrons are polarised both parallel (+) and  
-anti-parallel (-) to the x' axis (see below). The possible states after 
-scattering from the sample are then 
+Let us consider that the incident neutrons are polarised both parallel (+) and
+anti-parallel (-) to the x' axis (see below). The possible states after
+scattering from the sample are then
 
 *  Non-spin flips: (+ +) and (- -)
 *  Spin flips:     (+ -) and (- +)
 
-.. image:: gen_mag_pic.bmp
+.. image:: gen_mag_pic.png
 
-Now let us assume that the angles of the *Q* vector and the spin-axis (x') 
-to the x-axis are |phi| and |theta|\ :sub:`up` respectively (see above). Then, 
-depending upon the polarization (spin) state of neutrons, the scattering 
-length densities, including the nuclear scattering length density (|beta|\ :sub:`N`\ ) 
+Now let us assume that the angles of the *Q* vector and the spin-axis (x')
+to the x-axis are $\phi$ and $\theta_\text{up}$ respectively (see above). Then,
+depending upon the polarization (spin) state of neutrons, the scattering
+length densities, including the nuclear scattering length density ($\beta_N$)
 are given as
 
 *  for non-spin-flips
 
-   .. image:: sld1.gif
+   .. image:: sld1.png
 
 *  for spin-flips
 
-   .. image:: sld2.gif
+   .. image:: sld2.png
 
 where
 
-.. image:: mxp.gif
+.. image:: mxp.png
 
-.. image:: myp.gif
+.. image:: myp.png
 
-.. image:: mzp.gif
+.. image:: mzp.png
 
-.. image:: mqx.gif
+.. image:: mqx.png
 
-.. image:: mqy.gif
+.. image:: mqy.png
 
-Here the *M0*\ :sub:`x`\ , *M0*\ :sub:`y` and *M0*\ :sub:`z` are the x, y and z 
-components of the magnetisation vector in the laboratory xyz frame. 
+Here the $M0_x$, $M0_y$ and $M0_z$ are the $x$, $y$ and $z$
+components of the magnetisation vector in the laboratory $xyz$ frame.
 
 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
@@ -113,22 +115,22 @@
 --------------
 
-.. image:: gen_gui_help.bmp
+.. image:: gen_gui_help.png
 
-After computation the result will appear in the *Theory* box in the SasView  
+After computation the result will appear in the *Theory* box in the SasView
 *Data Explorer* panel.
 
-*Up_frac_in* and *Up_frac_out* are the ratio 
+*Up_frac_in* and *Up_frac_out* are the ratio
 
    (spin up) / (spin up + spin down)
-   
+
 of neutrons before the sample and at the analyzer, respectively.
 
-*NOTE 1. The values of* Up_frac_in *and* Up_frac_out *must be in the range 
+*NOTE 1. The values of* Up_frac_in *and* Up_frac_out *must be in the range
 0.0 to 1.0. Both values are 0.5 for unpolarized neutrons.*
 
-*NOTE 2. This computation is totally based on the pixel (or atomic) data fixed 
+*NOTE 2. This computation is totally based on the pixel (or atomic) data fixed
 in xyz coordinates. No angular orientational averaging is considered.*
 
-*NOTE 3. For the nuclear scattering length density, only the real component 
+*NOTE 3. For the nuclear scattering length density, only the real component
 is taken account.*
 
@@ -139,15 +141,15 @@
 
 The SANS Calculator tool can read some PDB, OMF or SLD files but ignores
-polarized/magnetic scattering when doing so, thus related parameters such as 
+polarized/magnetic scattering when doing so, thus related parameters such as
 *Up_frac_in*, etc, will be ignored.
 
-The calculation for fixed orientation uses Equation 1 above resulting in a 2D 
-output, whereas the scattering calculation averaged over all the orientations 
+The calculation for fixed orientation uses Equation 1 above resulting in a 2D
+output, whereas the scattering calculation averaged over all the orientations
 uses the Debye equation below providing a 1D output
 
-.. image:: gen_debye_eq.gif
+.. image:: gen_debye_eq.png
 
-where *v*\ :sub:`j` |beta|\ :sub:`j` |equiv| *b*\ :sub:`j` is the scattering 
-length of the j'th atom. The calculation output is passed to the *Data Explorer* 
+where $v_j \beta_j \equiv b_j$ is the scattering
+length of the $j^\text{th}$ atom. The calculation output is passed to the *Data Explorer*
 for further use.
 
Index: src/sas/sasgui/perspectives/calculator/media/sld_calculator_help.rst
===================================================================
--- src/sas/sasgui/perspectives/calculator/media/sld_calculator_help.rst	(revision f93b473fdbbdf1cc25efbb46c7adadea0e7d276d)
+++ src/sas/sasgui/perspectives/calculator/media/sld_calculator_help.rst	(revision 5ed76f8390eac56ff5d3779fd9c454d0c8fe1dc0)
@@ -10,10 +10,12 @@
 -----------
 
-The neutron scattering length density (SLD) is defined as
+The neutron scattering length density (SLD, $\beta_N$) is defined as
 
-  SLD = (b_c1 + b_c2 + ... + b_cn) / Vm
+.. math::
 
-where b_ci is the bound coherent scattering length of ith of n atoms in a molecule
-with the molecular volume Vm
+  \beta_N = (b_{c1} + b_{c2} + ... + b_{cn}) / V_m
+
+where $b_{ci}$ is the bound coherent scattering length of ith of n atoms in a molecule
+with the molecular volume $V_m$.
 
 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
@@ -22,8 +24,8 @@
 ----------------------------
 
-To calculate scattering length densities enter the empirical formula of a 
+To calculate scattering length densities enter the empirical formula of a
 compound and its mass density and click "Calculate".
 
-Entering a wavelength value is optional (a default value of 6.0 |Ang| will 
+Entering a wavelength value is optional (a default value of 6.0 |Ang| will
 be used).
 
@@ -38,19 +40,19 @@
 *  Parentheses can be nested, such as "(CaCO3(H2O)6)1".
 
-*  Isotopes are represented by their atomic number in *square brackets*, such 
+*  Isotopes are represented by their atomic number in *square brackets*, such
    as "CaCO[18]3+6H2O", H[1], or H[2].
 
 *  Numbers of atoms can be integer or decimal, such as "CaCO3+(3HO0.5)2".
 
-*  The SLD of mixtures can be calculated as well. For example, for a 70-30 
+*  The SLD of mixtures can be calculated as well. For example, for a 70-30
    mixture of H2O/D2O write "H14O7+D6O3" or more simply "H7D3O5" (i.e. this says
    7 hydrogens, 3 deuteriums, and 5 oxygens) and enter a mass density calculated
    on the percentages of H2O and D2O.
 
-*  Type "C[13]6 H[2]12 O[18]6" for C(13)6H(2)12O(18)6 (6 Carbon-13 atoms, 12 
+*  Type "C[13]6 H[2]12 O[18]6" for C(13)6H(2)12O(18)6 (6 Carbon-13 atoms, 12
    deuterium atoms, and 6 Oxygen-18 atoms).
-   
+
 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
 
-.. note::  This help document was last changed by Steve King, 01May2015
+.. note::  This help document was last changed by Paul Kienzle, 05Apr2017
 
Index: src/sas/sasgui/perspectives/calculator/media/slit_calculator_help.rst
===================================================================
--- src/sas/sasgui/perspectives/calculator/media/slit_calculator_help.rst	(revision f93b473fdbbdf1cc25efbb46c7adadea0e7d276d)
+++ src/sas/sasgui/perspectives/calculator/media/slit_calculator_help.rst	(revision 5ed76f8390eac56ff5d3779fd9c454d0c8fe1dc0)
@@ -11,10 +11,9 @@
 -----------
 
-This tool enables X-ray users to calculate the slit size (FWHM/2) for smearing 
+This tool enables X-ray users to calculate the slit size (FWHM/2) for smearing
 based on their half beam profile data.
 
 *NOTE! Whilst it may have some more generic applicability, the calculator has
-only been tested with beam profile data from Anton-Paar SAXSess*\ |TM|\  
-*software.*
+only been tested with beam profile data from Anton-Paar SAXSess:sup:`TM` software.*
 
 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
@@ -27,11 +26,11 @@
 2) Load a beam profile file in the *Data* field using the *Browse* button.
 
-   *NOTE! To see an example of the beam profile file format, visit the file 
+   *NOTE! To see an example of the beam profile file format, visit the file
    beam profile.DAT in your {installation_directory}/SasView/test folder.*
 
-3) Once a data is loaded, the slit size is automatically computed and displayed 
+3) Once a data is loaded, the slit size is automatically computed and displayed
    in the tool window.
 
-*NOTE! The beam profile file does not carry any information about the units of 
+*NOTE! The beam profile file does not carry any information about the units of
 the Q data. This calculator assumes the data has units of 1/\ |Ang|\ . If the
 data is not in these units it must be manually converted beforehand.*
Index: src/sas/sasgui/perspectives/corfunc/media/corfunc_help.rst
===================================================================
--- src/sas/sasgui/perspectives/corfunc/media/corfunc_help.rst	(revision d78b5cb8640ad6951b4ff99f576d1033eaebf0c5)
+++ src/sas/sasgui/perspectives/corfunc/media/corfunc_help.rst	(revision d78b5cb8640ad6951b4ff99f576d1033eaebf0c5)
@@ -71,5 +71,5 @@
 regions as shown below.
 
-.. figure:: fig1.gif
+.. figure:: fig1.png
    :align: center
 
@@ -145,5 +145,5 @@
 performed.
 
-.. figure:: fig2.gif
+.. figure:: fig2.png
    :align: center
 
Index: src/sas/sasgui/perspectives/fitting/basepage.py
===================================================================
--- src/sas/sasgui/perspectives/fitting/basepage.py	(revision 33dc18f1612814b89c60662f4f734c0d8831ac72)
+++ src/sas/sasgui/perspectives/fitting/basepage.py	(revision 33dc18f1612814b89c60662f4f734c0d8831ac72)
@@ -2788,5 +2788,5 @@
     def _on_mag_angle_help(self, event):
         """
-        Bring up Magnetic Angle definition bmp image whenever the ? button
+        Bring up Magnetic Angle definition.png image whenever the ? button
         is clicked. Calls DocumentationWindow with the path of the location
         within the documentation tree (after /doc/ ....". When using old
@@ -2802,5 +2802,5 @@
         """
 
-        _TreeLocation = "_images/M_angles_pic.bmp"
+        _TreeLocation = "_images/M_angles_pic.png"
         _doc_viewer = DocumentationWindow(self, wx.ID_ANY, _TreeLocation, "",
                                           "Magnetic Angle Defintions")
@@ -2808,5 +2808,5 @@
     def _on_mag_help(self, event):
         """
-        Bring up Magnetic Angle definition bmp image whenever the ? button
+        Bring up Magnetic Angle definition.png image whenever the ? button
         is clicked. Calls DocumentationWindow with the path of the location
         within the documentation tree (after /doc/ ....". When using old
Index: src/sas/sasgui/perspectives/fitting/media/fitting_help.rst
===================================================================
--- src/sas/sasgui/perspectives/fitting/media/fitting_help.rst	(revision ca383a0379b7c34a82f7245aa76f89169ddeb5d1)
+++ src/sas/sasgui/perspectives/fitting/media/fitting_help.rst	(revision ca383a0379b7c34a82f7245aa76f89169ddeb5d1)
@@ -4,13 +4,13 @@
 .. by S King, ISIS, during SasView CodeCamp-III in Feb 2015.
 
-.. |inlineimage004| image:: sm_image004.gif
-.. |inlineimage005| image:: sm_image005.gif
-.. |inlineimage008| image:: sm_image008.gif
-.. |inlineimage009| image:: sm_image009.gif
-.. |inlineimage010| image:: sm_image010.gif
-.. |inlineimage011| image:: sm_image011.gif
-.. |inlineimage012| image:: sm_image012.gif
-.. |inlineimage018| image:: sm_image018.gif
-.. |inlineimage019| image:: sm_image019.gif
+.. |inlineimage004| image:: sm_image004.png
+.. |inlineimage005| image:: sm_image005.png
+.. |inlineimage008| image:: sm_image008.png
+.. |inlineimage009| image:: sm_image009.png
+.. |inlineimage010| image:: sm_image010.png
+.. |inlineimage011| image:: sm_image011.png
+.. |inlineimage012| image:: sm_image012.png
+.. |inlineimage018| image:: sm_image018.png
+.. |inlineimage019| image:: sm_image019.png
 
 
@@ -90,5 +90,5 @@
 *View* option on the menubar, or click on the *Modify* button on the *Fit Page*.
 
-.. image:: cat_fig0.bmp
+.. image:: cat_fig0.png
 
 The categorization of all models except the user supplied Plugin Models can be
@@ -96,5 +96,5 @@
 hidden from view in the drop-down menus.
 
-.. image:: cat_fig1.bmp
+.. image:: cat_fig1.png
 
 Changing category
@@ -105,5 +105,5 @@
 to make the required changes.
 
-.. image:: cat_fig2.bmp
+.. image:: cat_fig2.png
 
 To create a category for the selected model, click the *Add* button. In order
@@ -179,5 +179,5 @@
 GUI using the *New Plugin Model Function*.
 
-.. image:: new_model.bmp
+.. image:: new_model.png
 
 When using this feature, be aware that even if your code has errors, including 
@@ -228,5 +228,5 @@
 ^^^^^^^^^^^^^^^^
 
-.. image:: sum_model.bmp
+.. image:: sum_model.png
 
 This option creates a custom Plugin Model of the form::
@@ -449,5 +449,5 @@
 
 In the bottom left corner of the *Fit Page* is a box displaying the normalised value
-of the statistical |chi|\  :sup:`2` parameter returned by the optimiser.
+of the statistical $\chi^2$ parameter returned by the optimiser.
 
 Now check the box for another model parameter and click *Fit* again. Repeat this
@@ -455,5 +455,5 @@
 fit of the theory to the experimental data improves the value of 'chi2/Npts' will
 decrease. A good model fit should easily produce values of 'chi2/Npts' that are
-close to zero, and certainly <100. See :ref:`Assessing_Fit_Quality`.
+close to one, and certainly <100. See :ref:`Assessing_Fit_Quality`.
 
 SasView has a number of different optimisers (see the section :ref:`Fitting_Options`).
@@ -579,5 +579,5 @@
 at the bottom of that panel and *Send To Fitting*. A *BatchPage* will be created.
 
-.. image:: batch_button_area.bmp
+.. image:: batch_button_area.png
 
 *NB: The Batch Page can also be created by checking the Batch Mode radio button*
@@ -601,5 +601,5 @@
 will all appear on one graph.
 
-.. image:: view_button.bmp
+.. image:: view_button.png
 
 *NB: In theory, returning to the BatchPage and changing the name of the I(Q)*
@@ -637,5 +637,5 @@
 bar.
 
-.. image:: restore_batch_window.bmp
+.. image:: restore_batch_window.png
 
 Once a batch fit is completed, all model parameters are displayed but *not*
@@ -653,5 +653,5 @@
 label.
 
-.. image:: edit_menu.bmp
+.. image:: edit_menu.png
 
 *NB: If there is an existing Grid Window and another batch fit is performed,*
@@ -666,5 +666,5 @@
 *Window* menu bar. The loaded parameters will appear in a new table tab.
 
-.. image:: file_menu.bmp
+.. image:: file_menu.png
 
 *NB: Saving the Grid Window does not save any experimental data, residuals*
@@ -684,5 +684,5 @@
 but different labels and units can be entered manually.
 
-.. image:: plot_button.bmp
+.. image:: plot_button.png
 
 The *X/Y-axis Selection Range* can be edited manually. The text control box
Index: src/sas/sasgui/perspectives/fitting/media/mag_help.rst
===================================================================
--- src/sas/sasgui/perspectives/fitting/media/mag_help.rst	(revision eca66a1e1d34267aaf9e3dd7b24b04ab5ea44bc1)
+++ src/sas/sasgui/perspectives/fitting/media/mag_help.rst	(revision 5ed76f8390eac56ff5d3779fd9c454d0c8fe1dc0)
@@ -4,13 +4,13 @@
 .. by S King, ISIS, during SasView CodeCamp-III in Feb 2015.
 
-.. |inlineimage004| image:: sm_image004.gif
-.. |inlineimage005| image:: sm_image005.gif
-.. |inlineimage008| image:: sm_image008.gif
-.. |inlineimage009| image:: sm_image009.gif
-.. |inlineimage010| image:: sm_image010.gif
-.. |inlineimage011| image:: sm_image011.gif
-.. |inlineimage012| image:: sm_image012.gif
-.. |inlineimage018| image:: sm_image018.gif
-.. |inlineimage019| image:: sm_image019.gif
+.. |inlineimage004| image:: sm_image004.png
+.. |inlineimage005| image:: sm_image005.png
+.. |inlineimage008| image:: sm_image008.png
+.. |inlineimage009| image:: sm_image009.png
+.. |inlineimage010| image:: sm_image010.png
+.. |inlineimage011| image:: sm_image011.png
+.. |inlineimage012| image:: sm_image012.png
+.. |inlineimage018| image:: sm_image018.png
+.. |inlineimage019| image:: sm_image019.png
 
 
@@ -20,5 +20,5 @@
 --------------------------------
 
-Magnetic scattering is implemented in five (2D) models 
+Magnetic scattering is implemented in five (2D) models
 
 *  *sphere*
@@ -28,20 +28,20 @@
 *  *parallelepiped*
 
-In general, the scattering length density (SLD, = |beta|) in each region where the
+In general, the scattering length density (SLD, = $\beta$) in each region where the
 SLD is uniform, is a combination of the nuclear and magnetic SLDs and, for polarised
 neutrons, also depends on the spin states of the neutrons.
 
-For magnetic scattering, only the magnetization component, *M*\ :sub:`perp`,
-perpendicular to the scattering vector *Q* contributes to the the magnetic
+For magnetic scattering, only the magnetization component, $M_\perp$,
+perpendicular to the scattering vector $Q$ contributes to the the magnetic
 scattering length.
 
-.. image:: mag_vector.bmp
+.. image:: mag_vector.png
 
 The magnetic scattering length density is then
 
-.. image:: dm_eq.gif
+.. image:: dm_eq.png
 
-where |gamma| = -1.913 is the gyromagnetic ratio, |mu|\ :sub:`B` is the
-Bohr magneton, *r*\ :sub:`0` is the classical radius of electron, and |sigma|
+where $\gamma = -1.913$ is the gyromagnetic ratio, $\mu_B$ is the
+Bohr magneton, $r_0$ is the classical radius of electron, and $\sigma$
 is the Pauli spin.
 
@@ -53,39 +53,39 @@
 Spin-flips    (+ -) and (- +)
 
-.. image:: M_angles_pic.bmp
+.. image:: M_angles_pic.png
 
-If the angles of the *Q* vector and the spin-axis (*x'*) to the *x*-axis are |phi|
-and |theta|\ :sub:`up`, respectively, then, depending on the spin state of the
+If the angles of the $Q$ vector and the spin-axis (*x'*) to the *x*-axis are $\phi$
+and $\theta_\text{up}$, respectively, then, depending on the spin state of the
 neutrons, the scattering length densities, including the nuclear scattering
-length density (|beta|\ :sub:`N`) are
+length density ($\beta_N$) are
 
-.. image:: sld1.gif
+.. image:: sld1.png
 
 when there are no spin-flips, and
 
-.. image:: sld2.gif
+.. image:: sld2.png
 
 when there are, and
 
-.. image:: mxp.gif
+.. image:: mxp.png
 
-.. image:: myp.gif
+.. image:: myp.png
 
-.. image:: mzp.gif
+.. image:: mzp.png
 
-.. image:: mqx.gif
+.. image:: mqx.png
 
-.. image:: mqy.gif
+.. image:: mqy.png
 
-Here, *M*\ :sub:`0x`, *M*\ :sub:`0y` and *M*\ :sub:`0z` are the x, y and z components
-of the magnetization vector given in the laboratory xyz frame given by
+Here, $M_{0x}$, $M_{0y}$ and $M_{0z}$ are the $x$, $y$ and $z$ components
+of the magnetization vector given in the laboratory $xyz$ frame given by
 
-.. image:: m0x_eq.gif
+.. image:: m0x_eq.png
 
-.. image:: m0y_eq.gif
+.. image:: m0y_eq.png
 
-.. image:: m0z_eq.gif
+.. image:: m0z_eq.png
 
-and the magnetization angles |theta|\ :sub:`M` and |phi|\ :sub:`M` are defined in
+and the magnetization angles $\theta_M$ and $\phi_M$ are defined in
 the figure above.
 
@@ -93,8 +93,8 @@
 
 ===========   ================================================================
- M0_sld        = *D*\ :sub:`M` *M*\ :sub:`0`
- Up_theta      = |theta|\ :sub:`up`
- M_theta       = |theta|\ :sub:`M`
- M_phi         = |phi|\ :sub:`M`
+ M0_sld        = $D_M M_0$
+ Up_theta      = $\theta_\text{up}$
+ M_theta       = $\theta_M$
+ M_phi         = $\phi_M$
  Up_frac_i     = (spin up)/(spin up + spin down) neutrons *before* the sample
  Up_frac_f     = (spin up)/(spin up + spin down) neutrons *after* the sample
Index: src/sas/sasgui/perspectives/fitting/media/pd_help.rst
===================================================================
--- src/sas/sasgui/perspectives/fitting/media/pd_help.rst	(revision b64b87c874ab0edc565e9c415decc839e3214c8c)
+++ src/sas/sasgui/perspectives/fitting/media/pd_help.rst	(revision 5ed76f8390eac56ff5d3779fd9c454d0c8fe1dc0)
@@ -4,13 +4,13 @@
 .. by S King, ISIS, during SasView CodeCamp-III in Feb 2015.
 
-.. |inlineimage004| image:: sm_image004.gif
-.. |inlineimage005| image:: sm_image005.gif
-.. |inlineimage008| image:: sm_image008.gif
-.. |inlineimage009| image:: sm_image009.gif
-.. |inlineimage010| image:: sm_image010.gif
-.. |inlineimage011| image:: sm_image011.gif
-.. |inlineimage012| image:: sm_image012.gif
-.. |inlineimage018| image:: sm_image018.gif
-.. |inlineimage019| image:: sm_image019.gif
+.. |inlineimage004| image:: sm_image004.png
+.. |inlineimage005| image:: sm_image005.png
+.. |inlineimage008| image:: sm_image008.png
+.. |inlineimage009| image:: sm_image009.png
+.. |inlineimage010| image:: sm_image010.png
+.. |inlineimage011| image:: sm_image011.png
+.. |inlineimage012| image:: sm_image012.png
+.. |inlineimage018| image:: sm_image018.png
+.. |inlineimage019| image:: sm_image019.png
 
 
@@ -24,8 +24,10 @@
 form factor is normalized by the average particle volume such that
 
-*P(q) = scale* * \ <F*\F> / *V + bkg*
+.. math::
 
-where F is the scattering amplitude and the \<\> denote an average over the size
-distribution.
+    P(q) = \text{scale} \langle F^*F rangle V + \text{background}
+
+where $F$ is the scattering amplitude and $\langle\cdot\rangle$ denotes an average
+over the size distribution.
 
 Users should note that this computation is very intensive. Applying polydispersion
@@ -57,8 +59,8 @@
 .. image:: pd_image001.png
 
-where *xmean* is the mean of the distribution, *w* is the half-width, and *Norm* is a
-normalization factor which is determined during the numerical calculation.
+where $x_{mean}$ is the mean of the distribution, $w$ is the half-width, and $Norm$
+is a normalization factor which is determined during the numerical calculation.
 
-Note that the standard deviation and the half width *w* are different!
+Note that the standard deviation and the half width $w$ are different!
 
 The standard deviation is
@@ -81,5 +83,5 @@
 .. image:: pd_image005.png
 
-where *xmean* is the mean of the distribution and *Norm* is a normalization factor
+where $x_{mean}$ is the mean of the distribution and $Norm$ is a normalization factor
 which is determined during the numerical calculation.
 
@@ -100,6 +102,6 @@
 .. image:: pd_image007.png
 
-where |mu|\ =ln(*xmed*), *xmed* is the median value of the distribution, and
-*Norm* is a normalization factor which will be determined during the numerical
+where $\mu=\ln(x_{med})$, $x_{med}$ is the median value of the distribution, and
+$Norm$ is a normalization factor which will be determined during the numerical
 calculation.
 
@@ -107,5 +109,5 @@
 size parameter in the *FitPage*, for example, radius = 60.
 
-The polydispersity is given by |sigma|
+The polydispersity is given by $\sigma$
 
 .. image:: pd_image008.png
@@ -115,10 +117,10 @@
 .. image:: pd_image009.png
 
-The mean value is given by *xmean*\ =exp(|mu|\ +p\ :sup:`2`\ /2). The peak value
-is given by *xpeak*\ =exp(|mu|-p\ :sup:`2`\ ).
+The mean value is given by $x_{mean} =\exp(\mu + p^2 /2)$. The peak value
+is given by $x_{peak} =\exp(\mu-p^2)$.
 
 .. image:: pd_image010.jpg
 
-This distribution function spreads more, and the peak shifts to the left, as *p*
+This distribution function spreads more, and the peak shifts to the left, as $p$
 increases, requiring higher values of Nsigmas and Npts.
 
@@ -132,9 +134,11 @@
 .. image:: pd_image011.png
 
-where *xmean* is the mean of the distribution and *Norm* is a normalization factor
-which is determined during the numerical calculation, and *z* is a measure of the
+where $x_{mean}$ is the mean of the distribution and $Norm$ is a normalization factor
+which is determined during the numerical calculation, and $z$ is a measure of the
 width of the distribution such that
 
-z = (1-p\ :sup:`2`\ ) / p\ :sup:`2`
+.. math::
+
+    z = (1-p^2 ) / p^2
 
 The polydispersity is
@@ -156,5 +160,5 @@
 
 This user-definable distribution should be given as as a simple ASCII text file
-where the array is defined by two columns of numbers: *x* and *f(x)*. The *f(x)*
+where the array is defined by two columns of numbers: $x$ and $f(x)$. The $f(x)$
 will be normalized by SasView during the computation.
 
@@ -172,5 +176,5 @@
 
 SasView only uses these array values during the computation, therefore any mean
-value of the parameter represented by *x* present in the *FitPage*
+value of the parameter represented by $x$ present in the *FitPage*
 will be ignored.
 
@@ -181,5 +185,5 @@
 
 Many commercial Dynamic Light Scattering (DLS) instruments produce a size
-polydispersity parameter, sometimes even given the symbol *p*! This parameter is
+polydispersity parameter, sometimes even given the symbol $p$! This parameter is
 defined as the relative standard deviation coefficient of variation of the size
 distribution and is NOT the same as the polydispersity parameters in the Lognormal
Index: src/sas/sasgui/perspectives/fitting/media/plugin.rst
===================================================================
--- src/sas/sasgui/perspectives/fitting/media/plugin.rst	(revision e081946a83f80fc072f03a743f0869493b2c2850)
+++ src/sas/sasgui/perspectives/fitting/media/plugin.rst	(revision e081946a83f80fc072f03a743f0869493b2c2850)
@@ -49,5 +49,5 @@
 
 Other models are available for download from our
-`Model Marketplace <http://marketplace.sasview.org/>`_. You can contribute your own models to the 
+`Model Marketplace <http://marketplace.sasview.org/>`_. You can contribute your own models to the
 Marketplace aswell.
 
@@ -83,5 +83,5 @@
     - without any capitalization or CamelCase
     - without incorporating the word "model"
-    - examples: *barbell* **not** *BarBell*; *broad_peak* **not** *BroadPeak*; 
+    - examples: *barbell* **not** *BarBell*; *broad_peak* **not** *BroadPeak*;
       *barbell* **not** *BarBellModel*
 
@@ -103,5 +103,5 @@
      at the top of the *.py* file
    - what you write here is abstracted into the SasView help documentation
-   - this is what other users will refer to when they want to know what your model does; 
+   - this is what other users will refer to when they want to know what your model does;
      so please be helpful!
 
@@ -128,5 +128,5 @@
      converted/created the model file
 
-Models that do not conform to these requirements will *never* be incorporated 
+Models that do not conform to these requirements will *never* be incorporated
 into the built-in library.
 
@@ -309,7 +309,7 @@
 defines the parameters that form the model.
 
-**Note: The order of the parameters in the definition will be the order of the 
-parameters in the user interface and the order of the parameters in Iq(), 
-Iqxy() and form_volume(). And** *scale* **and** *background* **parameters are 
+**Note: The order of the parameters in the definition will be the order of the
+parameters in the user interface and the order of the parameters in Iq(),
+Iqxy() and form_volume(). And** *scale* **and** *background* **parameters are
 implicit to all models, so they do not need to be included in the parameter table.**
 
@@ -492,5 +492,5 @@
 and it includes orientation parameters.
 
-*form_volume* defines the volume of the shape. As in python models, it 
+*form_volume* defines the volume of the shape. As in python models, it
 includes only the volume parameters.
 
@@ -626,5 +626,5 @@
 
     sas_gamma(x):
-        Gamma function $\text{sas_gamma}(x) = \Gamma(x)$.
+        Gamma function sas_gamma\ $(x) = \Gamma(x)$.
 
         The standard math function, tgamma(x) is unstable for $x < 1$
@@ -636,7 +636,7 @@
     sas_erf(x), sas_erfc(x):
         Error function
-        $\text{sas_erf}(x) = \frac{2}{\sqrt\pi}\int_0^x e^{-t^2}\,dt$
+        sas_erf\ $(x) = \frac{2}{\sqrt\pi}\int_0^x e^{-t^2}\,dt$
         and complementary error function
-        $\text{sas_erfc}(x) = \frac{2}{\sqrt\pi}\int_x^{\infty} e^{-t^2}\,dt$.
+        sas_erfc $(x) = \frac{2}{\sqrt\pi}\int_x^{\infty} e^{-t^2}\,dt$.
 
         The standard math functions erf(x) and erfc(x) are slower and broken
@@ -647,5 +647,5 @@
 
     sas_J0(x):
-        Bessel function of the first kind $\text{sas_J0}(x)=J_0(x)$ where
+        Bessel function of the first kind sas_J0\ $(x)=J_0(x)$ where
         $J_0(x) = \frac{1}{\pi}\int_0^\pi \cos(x\sin(\tau))\,d\tau$.
 
@@ -656,5 +656,5 @@
 
     sas_J1(x):
-        Bessel function of the first kind  $\text{sas_J1}(x)=J_1(x)$ where
+        Bessel function of the first kind  sas_J1\ $(x)=J_1(x)$ where
         $J_1(x) = \frac{1}{\pi}\int_0^\pi \cos(\tau - x\sin(\tau))\,d\tau$.
 
@@ -666,5 +666,5 @@
     sas_JN(n, x):
         Bessel function of the first kind and integer order $n$:
-        $\text{sas_JN}(n, x)=J_n(x)$ where
+        sas_JN\ $(n, x)=J_n(x)$ where
         $J_n(x) = \frac{1}{\pi}\int_0^\pi \cos(n\tau - x\sin(\tau))\,d\tau$.
         If $n$ = 0 or 1, it uses sas_J0(x) or sas_J1(x), respectively.
@@ -676,5 +676,5 @@
 
     sas_Si(x):
-        Sine integral $\text{Si}(x) = \int_0^x \tfrac{\sin t}{t}\,dt$.
+        Sine integral Si\ $(x) = \int_0^x \tfrac{\sin t}{t}\,dt$.
 
         This function uses Taylor series for small and large arguments:
@@ -701,5 +701,5 @@
     sas_3j1x_x(x):
         Spherical Bessel form
-        $\text{sph_j1c}(x) = 3 j_1(x)/x = 3 (\sin(x) - x \cos(x))/x^3$,
+        sph_j1c\ $(x) = 3 j_1(x)/x = 3 (\sin(x) - x \cos(x))/x^3$,
         with a limiting value of 1 at $x=0$, where $j_1(x)$ is the spherical
         Bessel function of the first kind and first order.
@@ -712,5 +712,5 @@
 
     sas_2J1x_x(x):
-        Bessel form $\text{sas_J1c}(x) = 2 J_1(x)/x$, with a limiting value
+        Bessel form sas_J1c\ $(x) = 2 J_1(x)/x$, with a limiting value
         of 1 at $x=0$, where $J_1(x)$ is the Bessel function of first kind
         and first order.
@@ -835,5 +835,5 @@
 one return value for each point in the mesh grid.
 
-*NOTE: we may be removing or modifying this feature soon. As of the 
+*NOTE: we may be removing or modifying this feature soon. As of the
 time of writing, core-shell sphere returns (1., 1.) for VR, giving a volume
 ratio of 1.0.*
@@ -881,9 +881,9 @@
 ...............
 
-Either open the :ref:`Python_shell` (*Tools* > *Python Shell/Editor*) or the :ref:`Advanced_Plugin_Editor` (*Fitting* > *Plugin Model Operations* > *Advanced 
-Plugin Editor*), load your model, and then select *Run > Check Model* from the 
+Either open the :ref:`Python_shell` (*Tools* > *Python Shell/Editor*) or the :ref:`Advanced_Plugin_Editor` (*Fitting* > *Plugin Model Operations* > *Advanced
+Plugin Editor*), load your model, and then select *Run > Check Model* from the
 menu bar.
 
-An *Info* box will appear with the results of the compilation and a check that 
+An *Info* box will appear with the results of the compilation and a check that
 the model runs.
 
@@ -950,5 +950,5 @@
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
-**NB: For now we are not providing pylint with the installer version of SasView; 
+**NB: For now we are not providing pylint with the installer version of SasView;
 so unless you have a SasView build environment available, you can ignore this section!**
 
Index: src/sas/sasgui/perspectives/fitting/media/residuals_help.rst
===================================================================
--- src/sas/sasgui/perspectives/fitting/media/residuals_help.rst	(revision 780545820bf596bf3709c434f3eb26bcc29a1236)
+++ src/sas/sasgui/perspectives/fitting/media/residuals_help.rst	(revision 940d034ea7562ca2e4afc05df3a79bc972ca4095)
@@ -18,5 +18,5 @@
 also provides two other measures of the quality of a fit:
 
-*  |chi|\  :sup:`2` (or 'Chi2'; pronounced 'chi-squared')
+*  $\chi^2$ (or 'Chi2'; pronounced 'chi-squared')
 *  *Residuals*
 
@@ -32,15 +32,17 @@
 *Npts* such that
 
-  *Chi2/Npts* = { SUM[(*Y_i* - *Y_theory_i*)^2 / (*Y_error_i*)^2] } / *Npts*
+.. math::
 
-This differs slightly from what is sometimes called the 'reduced chi-squared'
+  \chi^2/N_{pts} =  \sum[(Y_i - \mathrm{theory}_i)^2 / \mathrm{error}_i^2] / N_{pts}
+
+This differs slightly from what is sometimes called the 'reduced $\chi^2$'
 because it does not take into account the number of fitting parameters (to
-calculate the number of 'degrees of freedom'), but the 'normalized chi-squared'
-and the 'reduced chi-squared' are very close to each other when *Npts* >> number of
-parameters.
+calculate the number of 'degrees of freedom'), but the 'normalized $\chi^2$
+and the 'reduced $\chi^2$ are very close to each other when $N_{pts} \gg
+\text{number of parameters}.
 
-For a good fit, *Chi2/Npts* tends to 0.
+For a good fit, $\chi^2/N_{pts}$ tends to 1.
 
-*Chi2/Npts* is sometimes referred to as the 'goodness-of-fit' parameter.
+$\chi^2/N_{pts}$ is sometimes referred to as the 'goodness-of-fit' parameter.
 
 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
@@ -53,10 +55,12 @@
 value and its *true* value is its error).
 
-*SasView* calculates 'normalized residuals', *R_i*, for each data point in the
+*SasView* calculates 'normalized residuals', $R_i$, for each data point in the
 fit:
 
-  *R_i* = (*Y_i* - *Y_theory_i*) / (*Y_err_i*)
+.. math::
 
-For a good fit, *R_i* ~ 0.
+  R_i = (Y_i - Y_theory_i) / (Y_err_i)
+
+For a good fit, $R_i \sim 0$.
 
 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
Index: src/sas/sasgui/perspectives/fitting/media/sm_help.rst
===================================================================
--- src/sas/sasgui/perspectives/fitting/media/sm_help.rst	(revision 27aabc18ac7747d6e4078aa2f94c97a7a3a3ee12)
+++ src/sas/sasgui/perspectives/fitting/media/sm_help.rst	(revision 5ed76f8390eac56ff5d3779fd9c454d0c8fe1dc0)
@@ -4,13 +4,13 @@
 .. by S King, ISIS, during SasView CodeCamp-III in Feb 2015.
 
-.. |inlineimage004| image:: sm_image004.gif
-.. |inlineimage005| image:: sm_image005.gif
-.. |inlineimage008| image:: sm_image008.gif
-.. |inlineimage009| image:: sm_image009.gif
-.. |inlineimage010| image:: sm_image010.gif
-.. |inlineimage011| image:: sm_image011.gif
-.. |inlineimage012| image:: sm_image012.gif
-.. |inlineimage018| image:: sm_image018.gif
-.. |inlineimage019| image:: sm_image019.gif
+.. |inlineimage004| image:: sm_image004.png
+.. |inlineimage005| image:: sm_image005.png
+.. |inlineimage008| image:: sm_image008.png
+.. |inlineimage009| image:: sm_image009.png
+.. |inlineimage010| image:: sm_image010.png
+.. |inlineimage011| image:: sm_image011.png
+.. |inlineimage012| image:: sm_image012.png
+.. |inlineimage018| image:: sm_image018.png
+.. |inlineimage019| image:: sm_image019.png
 
 
@@ -20,14 +20,14 @@
 ==================
 
-Sometimes the instrumental geometry used to acquire the experimental data has 
-an impact on the clarity of features in the reduced scattering curve. For 
-example, peaks or fringes might be slightly broadened. This is known as 
-*Q resolution smearing*. To compensate for this effect one can either try and 
-remove the resolution contribution - a process called *desmearing* - or add the 
-resolution contribution into a model calculation/simulation (which by definition 
-will be exact) to make it more representative of what has been measured 
+Sometimes the instrumental geometry used to acquire the experimental data has
+an impact on the clarity of features in the reduced scattering curve. For
+example, peaks or fringes might be slightly broadened. This is known as
+*Q resolution smearing*. To compensate for this effect one can either try and
+remove the resolution contribution - a process called *desmearing* - or add the
+resolution contribution into a model calculation/simulation (which by definition
+will be exact) to make it more representative of what has been measured
 experimentally - a process called *smearing*. SasView will do the latter.
 
-Both smearing and desmearing rely on functions to describe the resolution 
+Both smearing and desmearing rely on functions to describe the resolution
 effect. SasView provides three smearing algorithms:
 
@@ -36,5 +36,5 @@
 *  *2D Smearing*
 
-SasView also has an option to use Q resolution data (estimated at the time of 
+SasView also has an option to use $Q$ resolution data (estimated at the time of
 data reduction) supplied in a reduced data file: the *Use dQ data* radio button.
 
@@ -43,6 +43,6 @@
 dQ Smearing
 -----------
- 
-If this option is checked, SasView will assume that the supplied dQ values 
+
+If this option is checked, SasView will assume that the supplied $dQ$ values
 represent the standard deviations of Gaussian functions.
 
@@ -57,18 +57,18 @@
 The slit-smeared scattering intensity is defined by
 
-.. image:: sm_image002.gif
+.. image:: sm_image002.png
 
 where *Norm* is given by
 
-.. image:: sm_image003.gif
+.. image:: sm_image003.png
 
 **[Equation 1]**
 
-The functions |inlineimage004| and |inlineimage005|
-refer to the slit width weighting function and the slit height weighting 
-determined at the given *q* point, respectively. It is assumed that the weighting
+The functions $W_v(v)$ and $W_u(u)$
+refer to the slit width weighting function and the slit height weighting
+determined at the given $q$ point, respectively. It is assumed that the weighting
 function is described by a rectangular function, such that
 
-.. image:: sm_image006.gif
+.. image:: sm_image006.png
 
 **[Equation 2]**
@@ -76,55 +76,57 @@
 and
 
-.. image:: sm_image007.gif
+.. image:: sm_image007.png
 
 **[Equation 3]**
 
-so that |inlineimage008| |inlineimage009| for |inlineimage010| and *u*\ .
-
-Here |inlineimage011| and |inlineimage012| stand for
-the slit height (FWHM/2) and the slit width (FWHM/2) in *q* space.
+so that $\Delta q_\alpha = \int_0^\infty d\alpha W_\alpha(\alpha)$
+for $\alpha = v$ and $u$.
+
+Here $\Delta q_u$ and $\Delta q_v$ stand for
+the slit height (FWHM/2) and the slit width (FWHM/2) in $q$ space.
 
 This simplifies the integral in Equation 1 to
 
-.. image:: sm_image013.gif
+.. image:: sm_image013.png
 
 **[Equation 4]**
 
-which may be solved numerically, depending on the nature of |inlineimage011| and |inlineimage012| .
+which may be solved numerically, depending on the nature of
+$\Delta q_u$ and $\Delta q_v$.
 
 Solution 1
 ^^^^^^^^^^
 
-**For** |inlineimage012| **= 0 and** |inlineimage011| **= constant.**
-
-.. image:: sm_image016.gif
-
-For discrete *q* values, at the *q* values of the data points and at the *q*
-values extended up to *q*\ :sub:`N`\ = *q*\ :sub:`i` + |inlineimage011| the smeared
+**For $\Delta q_v= 0$ and $\Delta q_u = \text{constant}$.**
+
+.. image:: sm_image016.png
+
+For discrete $q$ values, at the $q$ values of the data points and at the $q$
+values extended up to $q_N = q_i + \Delta q_u$ the smeared
 intensity can be approximately calculated as
 
-.. image:: sm_image017.gif
+.. image:: sm_image017.png
 
 **[Equation 5]**
 
-where |inlineimage018| = 0 for *I*\ :sub:`s` when *j* < *i* or *j* > *N-1*.
+where |inlineimage018| = 0 for $I_s$ when $j < i$ or $j > N-1$.
 
 Solution 2
 ^^^^^^^^^^
 
-**For** |inlineimage012| **= constant and** |inlineimage011| **= 0.**
+**For $\Delta q_v = \text{constant}$ and $\Delta q_u= 0$.**
 
 Similar to Case 1
 
-|inlineimage019| for *q*\ :sub:`p` = *q*\ :sub:`i` - |inlineimage012| and *q*\ :sub:`N` = *q*\ :sub:`i` + |inlineimage012|
+|inlineimage019| for $q_p = q_i - \Delta q_v$ and $q_N = q_i + \Delta q_v$
 
 **[Equation 6]**
 
-where |inlineimage018| = 0 for *I*\ :sub:`s` when *j* < *p* or *j* > *N-1*.
+where |inlineimage018| = 0 for $I_s$ when $j < p$ or $j > N-1$.
 
 Solution 3
 ^^^^^^^^^^
 
-**For** |inlineimage011| **= constant and** |inlineimage011| **= constant.**
+**For $\Delta q_u = \text{constant}$ and $\Delta q_v = \text{constant}$.**
 
 In this case, the best way is to perform the integration of Equation 1
@@ -138,11 +140,10 @@
 numerical integration for the slit width. Then
 
-.. image:: sm_image020.gif
+.. image:: sm_image020.png
 
 **[Equation 7]**
 
-for *q*\ :sub:`p` = *q*\ :sub:`i` - |inlineimage012| and *q*\ :sub:`N` = *q*\ :sub:`i` + |inlineimage012|
-
-where |inlineimage018| = 0 for *I*\ :sub:`s` when *j* < *p* or *j* > *N-1*.
+for *q_p = q_i - \Delta q_v$ and $q_N = q_i + \Delta q_v$
+where |inlineimage018| = 0 for *I_s$ when $j < p$ or $j > N-1$.
 
 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
@@ -158,5 +159,5 @@
 Equation 6 becomes
 
-.. image:: sm_image021.gif
+.. image:: sm_image021.png
 
 **[Equation 8]**
@@ -171,33 +172,34 @@
 Thus
 
-.. image:: sm_image022.gif
+.. image:: sm_image022.png
 
 **[Equation 9]**
 
-In Equation 9, *x*\ :sub:`0` = *q* cos(|theta|), *y*\ :sub:`0` = *q* sin(|theta|), and
-the primed axes, are all in the coordinate rotated by an angle |theta| about
-the z-axis (see the figure below) so that *x'*\ :sub:`0` = *x*\ :sub:`0` cos(|theta|) +
-*y*\ :sub:`0` sin(|theta|) and *y'*\ :sub:`0` = -*x*\ :sub:`0` sin(|theta|) +
-*y*\ :sub:`0` cos(|theta|). Note that the rotation angle is zero for a x-y symmetric
-elliptical Gaussian distribution. The *A* is a normalization factor.
-
-.. image:: sm_image023.gif
-
-Now we consider a numerical integration where each of the bins in |theta| and *R* are
-*evenly* (this is to simplify the equation below) distributed by |bigdelta|\ |theta|
-and |bigdelta|\ R, respectively, and it is further assumed that *I(x',y')* is constant
+In Equation 9, $x_0 = q \cos(\theta)$, $y_0 = q \sin(\theta)$, and
+the primed axes, are all in the coordinate rotated by an angle $\theta$ about
+the z-axis (see the figure below) so that
+$x'_0 = x_0 \cos(\theta) + y_0 \sin(\theta)$ and
+$y'_0 = -x_0 \sin(\theta) + y_0 \cos(\theta)$.
+Note that the rotation angle is zero for a $xy$ symmetric
+elliptical Gaussian distribution. The $A$ is a normalization factor.
+
+.. image:: sm_image023.png
+
+Now we consider a numerical integration where each of the bins in $\theta$ and $R$ are
+*evenly* (this is to simplify the equation below) distributed by $\Delta \theta$
+and $\Delta R$, respectively, and it is further assumed that $I(x',y')$ is constant
 within the bins. Then
 
-.. image:: sm_image024.gif
+.. image:: sm_image024.png
 
 **[Equation 10]**
 
 Since the weighting factor on each of the bins is known, it is convenient to
-transform *x'-y'* back to *x-y* coordinates (by rotating it by -|theta| around the
-*z* axis).
+transform $x'y'$ back to $xy$ coordinates (by rotating it by $-\theta$ around the
+$z$ axis).
 
 Then, for a polar symmetric smear
 
-.. image:: sm_image025.gif
+.. image:: sm_image025.png
 
 **[Equation 11]**
@@ -205,9 +207,9 @@
 where
 
-.. image:: sm_image026.gif
-
-while for a *x-y* symmetric smear
-
-.. image:: sm_image027.gif
+.. image:: sm_image026.png
+
+while for a $xy$ symmetric smear
+
+.. image:: sm_image027.png
 
 **[Equation 12]**
@@ -215,5 +217,5 @@
 where
 
-.. image:: sm_image028.gif
+.. image:: sm_image028.png
 
 The current version of the SasView uses Equation 11 for 2D smearing, assuming
@@ -225,9 +227,9 @@
 -------------------------
 
-In all the cases above, the weighting matrix *W* is calculated on the first call
-to a smearing function, and includes ~60 *q* values (finely and evenly binned)
-below (>0) and above the *q* range of data in order to smear all data points for
-a given model and slit/pinhole size. The *Norm*  factor is found numerically with the
-weighting matrix and applied on the computation of *I*\ :sub:`s`.
+In all the cases above, the weighting matrix $W$ is calculated on the first call
+to a smearing function, and includes ~60 $q$ values (finely and evenly binned)
+below (>0) and above the $q$ range of data in order to smear all data points for
+a given model and slit/pinhole size. The $Norm$  factor is found numerically with the
+weighting matrix and applied on the computation of $I_s$.
 
 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
Index: src/sas/sasgui/perspectives/invariant/media/invariant_help.rst
===================================================================
--- src/sas/sasgui/perspectives/invariant/media/invariant_help.rst	(revision 484141c7d5e50aeda61f3fe22bc28452ee9c344e)
+++ src/sas/sasgui/perspectives/invariant/media/invariant_help.rst	(revision 094b9ebf28997d46b643648b6775fc6c6b14cb0d)
@@ -10,35 +10,42 @@
 -----------
 
-The scattering, or Porod, invariant (Q*\) is a model-independent quantity that 
+The scattering, or Porod, invariant ($Q^*$) is a model-independent quantity that
 can be easily calculated from scattering data.
 
-For two phase systems, the scattering invariant is defined as the integral of 
-the square of the wave transfer (Q) multiplied by the scattering cross section 
-over the full range of Q from zero to infinity, that is
+For two phase systems, the scattering invariant is defined as the integral of
+the square of the wavevector transfer ($Q$) multiplied by the scattering cross section
+over the full range of $Q$ from zero to infinity, that is
 
-.. image:: image001.gif
+.. math::
 
-where *g = q* for pinhole geometry (SAS) and *g = q*\ :sub:`v` (the slit height) for  
-slit geometry (USAS).
+    Q^* = \int_0^\infty q^2I(q)\,dq
 
-The worth of Q*\  is that it can be used to determine the volume fraction and 
-the specific area of a sample. Whilst these quantities are useful in their own 
+in the case of pinhole geometry. For slit geometry the invariant is given by
+
+.. math::
+
+    Q^* = \Delta q_v \int_0^\infty qI(q)\,dq
+
+where $\Delta q_v$ is the slit height.
+
+The worth of $Q^*$  is that it can be used to determine the volume fraction and
+the specific area of a sample. Whilst these quantities are useful in their own
 right they can also be used in further analysis.
 
-The difficulty with using Q*\  arises from the fact that experimental data is 
-never measured over the range 0 =< *Q* =< infinity. At best, combining USAS and 
-WAS data might cover the range 1e-5 =< *Q* =< 10 1/\ |Ang| . Thus it is usually 
-necessary to extrapolate the experimental data to low and high *Q*. For this
+The difficulty with using $Q^*$  arises from the fact that experimental data is
+never measured over the range $0 \le Q \le \infty$. At best, combining USAS and
+WAS data might cover the range $10^{-5} \le Q \le 10$ 1/\ |Ang| . Thus it is usually
+necessary to extrapolate the experimental data to low and high $Q$. For this
 
-High-*Q* region (>= *Qmax* in data)
+High-\ $Q$ region (>= *Qmax* in data)
 
-*  The power law function *C*/*Q*\ :sup:`4` is used where the constant 
-   *C* (= 2.\ |pi|\ .(\ |bigdelta|\ |rho|\ ).\ *Sv*\ ) is to be found by fitting part of data 
-   within the range *Q*\ :sub:`N-m` to *Q*\ :sub:`N` (where m < N).
+*  The power law function $C/Q^4$ is used where the constant
+   $C = 2 \pi \Delta\rho S_v$ is to be found by fitting part of data
+   within the range $Q_{N-m}$ to $Q_N$ (where $m < N$).
 
-Low-*Q* region (<= *Qmin* in data)
+Low-\ $Q$ region (<= *Qmin* in data)
 
-*  The Guinier function *I0.exp(-Rg*\ :sup:`2`\ *Q*\ :sup:`2`\ */3)* where *I0* 
-   and *Rg* are obtained by fitting as for the high-*Q* region above. 
+*  The Guinier function $I_0 exp(-R_g^2 Q^2/3)$ where $I_0$
+   and $R_g$ are obtained by fitting as for the high-\ $Q$ region above.
    Alternatively a power law can be used.
 
@@ -52,31 +59,31 @@
 2) Load some data with the *Data Explorer*.
 
-3) Select a dataset and use the *Send To* button on the *Data Explorer* to load 
+3) Select a dataset and use the *Send To* button on the *Data Explorer* to load
    the dataset into the *Invariant* panel.
 
-4) Use the *Customised Input* boxes on the *Invariant* panel to subtract 
-   any background, specify the contrast (i.e. difference in SLDs - this must be 
-   specified for the eventual value of Q*\  to be on an absolute scale), or to 
+4) Use the *Customised Input* boxes on the *Invariant* panel to subtract
+   any background, specify the contrast (i.e. difference in SLDs - this must be
+   specified for the eventual value of $Q^*$  to be on an absolute scale), or to
    rescale the data.
 
-5) Adjust the extrapolation range as necessary. In most cases the default 
+5) Adjust the extrapolation range as necessary. In most cases the default
    values will suffice.
 
 6) Click the *Compute* button.
 
-7) To include a lower and/or higher Q range, check the relevant *Enable 
+7) To include a lower and/or higher $Q$ range, check the relevant *Enable
    Extrapolate* check boxes.
-   
-   If power law extrapolations are chosen, the exponent can be either held 
-   fixed or fitted. The number of points, Npts, to be used for the basis of the 
+
+   If power law extrapolations are chosen, the exponent can be either held
+   fixed or fitted. The number of points, Npts, to be used for the basis of the
    extrapolation can also be specified.
 
-8) If the value of Q*\  calculated with the extrapolated regions is invalid, a 
+8) If the value of $Q^*$  calculated with the extrapolated regions is invalid, a
    red warning will appear at the top of the *Invariant* panel.
 
-   The details of the calculation are available by clicking the *Details* 
+   The details of the calculation are available by clicking the *Details*
    button in the middle of the panel.
 
-.. image:: image005.gif
+.. image:: image005.png
 
 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
@@ -88,11 +95,15 @@
 ^^^^^^^^^^^^^^^
 
-The volume fraction |phi| is related to Q*\  by
+The volume fraction $\phi$ is related to $Q^*$  by
 
-.. image:: image002.gif
+.. math::
 
-where |bigdelta|\ |rho| is the SLD contrast.
+    \phi(1 - \phi) = \frac{Q^*}{2\pi^2(\Delta\rho)^2} \equiv A
 
-.. image:: image003.gif
+where $\Delta\rho$ is the SLD contrast.
+
+.. math::
+
+    \phi = \frac{1 \pm \sqrt{1 - 4A}}{2}
 
 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
@@ -101,9 +112,11 @@
 ^^^^^^^^^^^^^^^^^^^^^
 
-The specific surface area *Sv* is related to Q*\  by
+The specific surface area $S_v$ is related to $Q^*$  by
 
-.. image:: image004.gif
+.. math::
 
-where *Cp* is the Porod constant.
+    S_v = \frac{2\pi\phi(1-\phi)C_p}{Q^*} = \frac{2\pi A C_p}{Q^*}
+
+where $C_p$ is the Porod constant.
 
 .. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
