-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
45 lines (39 loc) · 1.24 KB
/
index.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
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<link rel="stylesheet" href="./js/mathquill.css">
<script src="./js/jq.js"></script>
<script src="./js/mathquill.js"></script>
<style>
input {
height: 50px;
width: 500px;
font-size: 20px;
padding: 10px;
}
</style>
<body>
<!-- <input id="input" type="text"> -->
<p>Type math here: <span id="math-field"></span></p>
<p>LaTeX of what you typed: <span id="latex"></span></p>
<script>
var mathFieldSpan = document.getElementById('math-field');
var inputDom = document.getElementById('input');
var latexSpan = document.getElementById('latex');
var MQ = MathQuill.getInterface(2); // for backcompat
var mathField = MQ.MathField(mathFieldSpan, {
spaceBehavesLikeTab: true, // configurable
handlers: {
edit: function () { // useful event handlers
latexSpan.textContent = mathField.latex(); // simple API
}
}
});
</script>
</body>
</html>