MathJax HTML component

I am currently trying to set up a HTML component that sends what is typed in (an input box) to a HTML component, and the HTML component converts it into maths symbols using MathJax. My code so far in the HTML component is…

MathJax example

When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are $$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$

What this does is change the paragraph…

“When (a \ne 0), there are two solutions to (ax^2 + bx + c = 0) and they are
$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$”

In to…

What I would like to be able to do is to be able to type in the expression/equation into a input box and then this message is posted to the html component and the MathJax script is applied to display the maths correctly.

I understand how to post messages to HTML component, just not sure how to adapt the HTML code.


@andreas-kviby … I think you are the person who can help!? : )

It would be nice if someone could reply, stop me from just talking to myself.

Anyway, so far I have written this code in the html component

MathJax example

HTML Label

This works but only very rarely. So if I type in text into my input box, sometimes it coverts it into maths and other times it does not.
Can anyone help please?

any update??

Please add a new post with a link to refer back to this post rather than bumping up an old thread.

Andreas Kviby hasn’t been associated with Wix for a while now, so you won’t get any reply or help from him.

This previous post could add a little bit of info if you have not seen it already.

Also, you can find more info on the html component here.$w.HtmlComponent.html

Please note that as stated in the above links, if you use third party provided code then Wix won’t provide support for it.

If you are having issues with third party code, then you should be going through the third parties own support.!forum/mathjax-users

Also, they have their own API that you can look at using instead of html, which you can use with Wix HTTP Functions and/or Wix Fetch. (Although this looks like the API doc is still under construction, so you would need to contact them directly to get more info on the API).

Wix Examples

You can even see if Wix support their NodeJS in Wix Package Manager as well.