Calling a javascript function after all math is processed on a page

9 views
Skip to first unread message

Jason Alexander

unread,
Jan 11, 2023, 11:29:06 AM1/11/23
to mathja...@googlegroups.com
Hello,

I’m using MathJax v3 with reveal.js, and I’d like to be able to call a javascript function when all the math in the presentation has been processed so that I can go through and add some classes to the inserted elements.  (I have MathJax set to embed the math as SVG.) 

The following JQuery code works when I run it in the console after the page has loaded, but I can’t find a way to have it called automatically — other than a hack which calls it after five or six seconds have passed...

$(".math-fragments").each( function() {
$(this).find("g[data-mml-node='mtr']").each( function() {
$(this).addClass("fragment");
})
})

Many thanks!

Jason

Davide Cervone

unread,
Jan 11, 2023, 3:35:05 PM1/11/23
to mathja...@googlegroups.com
See the section of the documentation at


on performing actions after typesetting.

Davide


--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mathjax-users/3D454264-56BE-48FF-A06E-D8E30CF546DB%40gmail.com.

Reply all
Reply to author
Forward
0 new messages