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
  • #2925
Closed
Open
Issue created Sep 17, 2022 by Scruel Tao@scruel

MathjaxV2: Can't render elements and get result synchronously

Issue Summary

With MathJax.Hub.Queue, Seems that after 'Typeset' job done, the elements still will not be rendered fully, but outer code block can get the result I want to get, even that this outer block should not always act like this, consider it will be executed asynchronously. image

Steps to Reproduce:

After script loaded, just execute the following code in browser console:

var mathbox = document.createElement('div'); 
mathbox.innerHTML='$$\sum_x^33$$'
MathJax.Hub.Queue(
  ['Typeset', MathJax.Hub, mathbox, () => {console.log('callback', mathbox.innerHTML);}],
  ["PreProcess",MathJax.Hub],
  ["Delay",MathJax.Callback,5000],
  ["Process",MathJax.Hub],

  [() => {console.log('queue-next', mathbox.innerHTML);}]
);
console.log('outer', mathbox.innerHTML)

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? I want to have “callback”, “queue-next”, 'outer' all get the same result, rather than get an incomplete rendered DOM object with “processing” styles. The documentation mentioned that typeset will call the callback function after its process completed, and for all jobs pushed into the Queue, should be executed synchronously, but I can't get the rendered result like outside code block can.

Technical details:

  • MathJax Version: 2.7.9
  • Client OS: Windows
  • Browser: Firefox 102

I am using the following MathJax configuration: MathJax default

and loading MathJax via

    <script src="https://unpkg.com/mathjax@2.7.9/MathJax.js?config=TeX-AMS_CHTML"></script>
Assignee
Assign to
Time tracking