-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
executable file
·33 lines (31 loc) · 920 Bytes
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<script src="mathjax/MathJax.js">
MathJax.Hub.Config({
extensions: ["mml2jax.js"],
jax: ["input/MathML", "output/HTML-CSS"]
});
</script>
<script>
(function () {
var QUEUE = MathJax.Hub.queue; // shorthand for the queue
var math = null; // the element jax for the math output.
//
// Get the element jax when MathJax has produced it.
//
QUEUE.Push(function () {
math = MathJax.Hub.getAllJax("MathOutput")[0];
console.log('math',math);
});
//
// The onchange event handler that typesets the
// math entered by the user
//
window.UpdateMath = function (TeX) {
alert(TeX);
QUEUE.Push(["Text",math,TeX]);
}
})();
</script>
<textarea onKeyUp="UpdateMath(this.value)" cols="100"></textarea>
<div id="MathOutput" >
You typed: ${}$
</div>