Opened 8 years ago

Last modified 7 years ago

#639 assigned defect

Math not rendered without network connection (Windows)

Reported by: ajj Owned by: ajj
Priority: critical Milestone: SasView 4.3.0
Component: SasView Keywords:
Cc: Work Package: SasView Bug Fixing

Description

Testing on Windows 7, a lack of network connection means that the math in the documentation does not get rendered.

On the Mac, it is still being rendered even without a network connection.

I thought that mathjax was being bundled, so this should be working.

Change History (11)

comment:1 Changed 8 years ago by butler

  • Priority changed from major to critical

comment:2 Changed 8 years ago by butler

  • Owner set to pkienzle
  • Status changed from new to assigned

comment:3 Changed 8 years ago by pkienzle

MathJax can be shipped with SasView.

We need to add _static/MathJax to the doc tree, with the following files from the MathJax distribution (776 kB):

    MathJax.js
    config/TeX-AMS-MML_HTMLorMML-full.js
    fonts/HTML-CSS/TeX/woff/*
    jax/output/HTML-CSS/fonts/TeX/*

The html header needs the following:

    <script type="text/x-mathjax-config">
    MathJax.Hub.Config({
      "HTML-CSS": {
        //undefinedFamily: ["STIXGeneral, 'Arial Unicode MS', serif"],
        preferredFont: "TeX",
        availableFonts: ["TeX"],
        webFont: "TeX",
        imageFont: null
      }
    });
    </script>
    </script>
    <script type="text/javascript" src="../../_static/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full"></script>

We might be able to accomplish this by updating sphinx conf.py with:

    mathjax_path="MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full&delayStartupUntil=configured"

and adding _templates/layout.html with:

{% extends "!layout.html" %}

{%- block extrahead %}
       <script type="text/javascript">
       MathJax.Hub.Config({
           // displayAlign: "left",
           // displayIndent: "2.5em",
           "HTML-CSS": {
             //undefinedFamily: ["STIXGeneral, 'Arial Unicode MS', serif"],
             preferredFont: "TeX",
             availableFonts: ["TeX"],
             webFont: "TeX",
             imageFont: null
           }
       });
       MathJax.Hub.Configured()
       </script>
{% endblock %}

There are a few options for including MathJax with SasView:

  • Add the 776 kB of binary files to sasmodels or to sasview that you update from time to time with the latest MathJax?
  • Pull a particular tagged version of MathJax from github as part of the build, and copy the appropriate files and subdirectories?
Last edited 8 years ago by pkienzle (previous) (diff)

comment:4 Changed 8 years ago by butler

  • Owner changed from pkienzle to ajj

maybe best to move to 4.1? We could provide a PDF downladable somewhere?

comment:5 Changed 8 years ago by piotr

This is slightly more convoluted. On my windows box I need to also add

fonts/HTML-CSS/TeX/eot/*

Also,

extensions/

is required if we want to enable right-click context menu, as in the online version.
It is possible than on other machines/systems/OSes we need to add more subdirectories in fonts/*

Obviously adding everything is not an option, as uncompressed MathJax? is 172MB.

Last edited 8 years ago by piotr (previous) (diff)

comment:6 Changed 8 years ago by ajj

https://github.com/mathjax/MathJax-grunt-cleaner/blob/master/Gruntfile.js

seems to be the "official" way to do this - clone the repo and run grunt. However, this is yet another lot of infrastructure.

If it is all local, we should probably just have a script to pull in the right bits and update occasionally as mathjax changes.

comment:7 Changed 8 years ago by butler

  • Milestone changed from SasView 4.0.0 to SasView 4.1.0

a bit annoying when no network is available but not a show stopper and needs a bit more care than 2 days before a release — moving to 4.1

comment:8 Changed 8 years ago by butler

  • Milestone changed from SasView 4.1.0 to SasView 4.2.0

Didn't get addressed at code camp so moving to 4.2

comment:9 Changed 8 years ago by richardh

19th Oct 2016, on my windows 7 desktop, the equations in the docu are rendering only slowly if at all. Before they do render a message pops up briefly at bottom on docu screen which says:

File failed to load: https://cdn.mathjax.org/mathjax/contrib/a11y/accessibility-menu.js

Is this a different issue to the above, or is it just flaky web access here?

Richard

comment:10 Changed 7 years ago by ajj

From #948

Longer term, need to replace mathjax with katex, which is faster and smaller and easier to bundle with the application. This is closer to working on Qt than it is in wx.

comment:11 Changed 7 years ago by butler

  • Milestone changed from SasView 4.2.0 to SasView 4.3.0
Note: See TracTickets for help on using tickets.