-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.html
46 lines (44 loc) · 1.06 KB
/
demo.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
46
<!DOCTYPE html>
<html lang="en" data-lt-installed="true"><head>
<meta charset="UTF-8">
<title>Title</title>
<script>
const text ="\\begin{tabular}{l} \n"+
"佰染拾伍元弍角 \\\\\n"+
"司 \\\\\n"+
"税 \\\\\n"+
"额 \\\\\n"+
"完税凭证号码 \\\\\n"+
"开票人 张丽华\n"+
"\\end{tabular}\n"
</script>
<style>
#content {
max-width: 800px;
margin: auto;
}
</style>
<script>
let script = document.createElement('script');
script.src = "https://cdn.jsdelivr.net/npm/[email protected]/es5/bundle.js";
document.head.append(script);
script.onload = function() {
const isLoaded = window.loadMathJax();
if (isLoaded) {
console.log('Styles loaded!')
}
const el = window.document.getElementById('content-text');
if (el) {
const options = {
htmlTags: true
};
const html = window.render(text, options);
el.outerHTML = html;
}
};
</script>
</head>
<body>
<div id="content"><div id="content-text"></div></div>
</body>
</html>