Skip to content

migrate to mathjax 3

  • currently running with mathjax 2.7.0

  • major version is available mathjax 3.0.0 with many improvements

  • require to modify modules/plugin_dbui/dbui.py

      "mathjax", {
              "css": None,
              "debug": "static/plugin_mathjax/es5/tex-chtml.js",
              "lg": None,
              "libmin": "static/plugin_mathjax/es5/tex-chtml.js"}
  • require to modify src/plugin/MathJax.js. Few minor improvements. The core is in:

      onProcessMath: function () {
    
          "use strict";
    
          var me = this,
              dom = Ext.getDom(me.target.getEl());
    
          if ((!me.activated) || (dom === null)) {
              return;
          }
    
          // mask the viewport, MatJax process and unmask
          me.viewport.mask(me.textMask);
          MathJax.typeset([dom]);
          me.viewport.unmask();
      }
  • require to modify views/plugin_dbui/index.html:

      <script>
          window.MathJax = {
            tex: {
              inlineMath: [['$','$']],
              displayMath: [['$$','$$']],
              processEscapes: true
            },
            options: {
              renderActions: {
                addMenu: [],
                checkLoading: []
              },
              ignoreHtmlClass: 'tex2jax_ignore',
              processHtmlClass: 'tex2jax_process'
            }
          };
      </script>
  • in dec 2019, first tentative in the branch 33-python37-matjax3. It was almost working, but latex equation are not translated after an record update...

  • to be worked again may be with an update version of MathJax

  • update git repository of plugin_dbui/static/plugin_mathjax

  • ...

Edited by LE GAC Renaud