-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
41 lines (39 loc) · 940 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
34
35
36
37
38
39
40
41
<!DOCTYPE html>
<meta charset="UTF-8">
<head>
<script>
MathJax = {
tex: {
inlineMath: []
},
svg: {
fontCache: 'local'
}
};
</script>
<script src="./tex-svg.js"></script>
<script>
function convertLatex() {
let tex = document.getElementById("inpt").value;
var mathjax_node = MathJax.tex2svg(tex);
let screen = document.getElementById("display");
screen.innerHTML = "";
screen.appendChild(mathjax_node);
}
</script>
</head>
<body>
<p id="display">
</p>
<p id="test">
中文测试
</p>
<textarea id="inpt">
\begin{equation}
D(x) = \begin{cases}
1, & \text{如果 } x \in \mathbb{Q}; \\
0, & \text{如果 } x \in \mathbb{R};
\end{cases}
\end{equation}
</textarea>
</body>