MathJax icon indicating copy to clipboard operation
MathJax copied to clipboard

How to listen for proccessing finish v2.7

Open MrChaker opened this issue 1 year ago • 1 comments

How can I know that the typesetting is finished ,in version 2.7

MrChaker avatar Dec 15 '23 17:12 MrChaker

MathJax v2 uses a processing queue to handle synchronizing actions that it performs. You can add actions to that queue, and they will be performed in the order they were added to the queue. Since MathJax will have added its initial typesetting call to the queue, if you add an action, it will occur after the initial typesetting, so you can use that to tell you when MathJax has typeset the page.

For example, if you place

<script type="text/x-mathjax-config">
MathJax.Hub.Queue(function () {
  // MathJax initial typesetting is complete when this code runs.
});
</script>

just before the scrip that loads MathJax.js itself, your function will run when MathJax has finished typesetting the page.

dpvc avatar Dec 16 '23 17:12 dpvc