Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • M MathJax
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 304
    • Issues 304
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • MathJax
  • MathJax
  • Issues
  • #3014
Closed
Open
Issue created Mar 08, 2023 by Daisy@Daisy1213

use mathjax3 in andriod5 show error "getExplicit of null"

Replace the text below with the details of the issue you are facing.
DO NOT simply erase the form and type a free-form response.

Issue Summary

A summary of the issue and the browser/OS environment in which it occurs. If suitable, include the steps required to reproduce the bug.

Steps to Reproduce:

  1. This is the first step
  2. This is the second step
  3. Further steps, etc.

Any other information you want to share that is relevant to the issue being reported. Especially, why do you consider this to be a bug? What do you expect to happen instead?

Technical details:

  • MathJax Version: 3.2
  • Client OS: Mac OS X 11.5.2

I am using the following MathJax configuration:

  window.MathJax = {
    chtml: {
      matchFontHeight: false,
      mtextInheritFont: false
    },
    options: {
      renderActions: {
        addMenu: [],
        checkLoading: []
      },
      skipHtmlTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code', 'a'],
      includeHtmlTags: {
        br: '\n',
        wbr: '',
        '#comment': ''
      },
      ignoreHtmlClass: 'tex2jax_ignore',
      processHtmlClass: 'tex2jax_process'
    },
    tex: {
      inlineMath: [['<latex>', '</latex>'], ['$', '$'], ['_mathjax_','_mathjax_'], ['$','$'], ['$$','$$'], ['\\(','\\)']],
      displayMath: [],
      macros: {
        ykparallelogram: '\\unicode{x25B1}',
        ykparallel: '//'
      },
      autoload: {
        color: [],
        colorV2: ['color']
      },
      packages: {
        '[+]': ['trap-undefined'],
        '[-]': ['noundefined']
      }
    },
    loader: {
      load: ['[tex]/noerrors']
    },
    startup: {
      ready: function () {
        var tex = null;

        var Configuration = MathJax._.input.tex.Configuration.Configuration;
        var TexError = MathJax._.input.tex.TexError.default;
        Configuration.create('trap-undefined', {
          fallback: {
            macro: function (parser, cs) {
              tex.inputData.codecogs = true;
            },
            environment: function (parser, env) {
              tex.inputData.codecogs = true;
            }
          }
        });

        var toDOM = function (math, node, html) {
          this.setDocument(html);
          if (math.inputData.codecogs) {
            var adaptor = html.adaptor;
            if (math.display) adaptor.setAttribute(node, 'display', true);
            var imageNode = adaptor.node('img', {
              src: 'https://gallery.fbcontent.cn/latex?decode=false&fontSize=34&latex=' + encodeURIComponent(math.math.trim() + '\\quad'),
              alt: tex.math.trim()
            })
            imageNode.onload = function () {
              imageNode.style.height = imageNode.naturalHeight / 2 + 'px'
              imageNode.style.width = imageNode.naturalWidth / 2 + 'px'
            }
            html.adaptor.append(node, imageNode);
            math.display = null;
          } else {
            this._toDOM(math, node, html);
          }
        };

        var getOutputJax = MathJax.startup.getOutputJax;
        MathJax.startup.getOutputJax = function () {
          var output = getOutputJax();
          output._toDOM = output.toDOM;
          output.toDOM = toDOM;
          return output;
        }

        MathJax.startup.defaultReady();

        MathJax.startup.input[0].preFilters.add(function (filter) {
          var math = filter.math
          tex = math
        });

        MathJax.startup.output._toDOM = MathJax.startup.output.toDOM;
        MathJax.startup.output.toDOM = toDOM;

      }
    }
  }

and loading MathJax via

<script src="https://solar.fbcontent.cn/h5/solar-web-mathjax3/es5/tex-chtml.js"></script>

Supporting information:

  • Please supply a link to a (live) minimal example page, when possible.
  • If your issue is with the display of the mathematics produced by MathJax, include a screen snapshot that illustrates the problem, when possible.
  • Check your browser console window for any error messages, and include them here.
  • Include the MathJax configuration you are using, and the script tag that loads MathJax itself.
Assignee
Assign to
Time tracking