How to download the live demo for mathjax in https://www.mathjax.org/#demo

17 views
Skip to first unread message

Juan Ma

unread,
Oct 8, 2019, 2:45:28 AM10/8/19
to MathJax Development
Hello

I saw this live demo on mathjax website, https://www.mathjax.org/#demo.I want to use this demo on my page ,how can i download this?

Davide Cervone

unread,
Oct 19, 2019, 10:30:53 AM10/19/19
to MathJax Development
The main code controlling the demo is

     var input = document.getElementById('MathInput');
     var output = document.getElementById('MathPreview');

     window.typesetInput = function (button) {
       button.disabled = true;
       output.innerHTML = input.value.trim();
       MathJax.texReset();
       MathJax.typesetClear();
       MathJax.typesetPromise([output]).catch(function (err) {
         output.innerHTML = '';
         output.appendChild(document.createTextNode(err.message));
         console.error(err);
       }).then(function () {
         button.disabled = false;
       });
     }

You can also see complete examples at

https://github.com/mathjax/MathJax-demos-web#processing-user-input

as well.

Davide
Reply all
Reply to author
Forward
0 new messages