Mathjax support

Re: Mathjax support
Hello again,
do you know where should I insert this:?
$(window).on('action:ajaxify.end', function(event, data) { console.log(data); // to inspect what is passed back by NodeBB });
Thanks.
This dynamic mathjax is so great: https://cdn.mathjax.org/mathjax/latest/test/sampledynamic2.html

I am using https://www.npmjs.com/package/nodebbpluginkatex
to render mathjax script. It works good so far.

Im still looking for a dynamic mathjax support from nodebb...

Here:
$(window).on('action:posts.loaded action:ajaxify.end', function () { MathJax.Hub.Queue(["Typeset", MathJax.Hub, "content"]); });

@PitaJ
where should I put the code into? which file?

@SuperMike
I wish this plugin can number the equations and support center locating. Check my page with MathJax: link text. It is very wellorganised, the only problem is that you need to refresh the page. I also tested with Katex, looks it does not support with \mathbf{}?

@sharonyue you put that code in the custom HTML in the ACP inside a
<script> </script>
tag, or wherever you have the rest of your code.

@pitaj
Hello, I put the following<script> $(window).on('action:posts.loaded action:ajaxify.end', function () { MathJax.Hub.Queue(["Typeset", MathJax.Hub, "content"]); }); </script>
here:
And it does not work?... I still need to refresh the page to load mathjax.

You don't need
<script>
and</script>
in the custom JS portion of the page.

After I include that script I dont need to refresh page to show the equations. But I still cannot preview equations in PREVIEW panel... Is it possible to do that?

You can try adding
action:composer.preview
to the list of events you listen for. I don't know if it'll convert the Mathjax in the preview box, but it is worth a try.

@julian said in Mathjax support:
action:composer.preview
I tried this:
$(window).on('action:posts.loaded action:ajaxify.end action:composer.preview', function () { MathJax.Hub.Queue(["Typeset", MathJax.Hub, "content"]); });
Unfortunately it does not work ..