-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.html
More file actions
44 lines (35 loc) · 1.4 KB
/
test.html
File metadata and controls
44 lines (35 loc) · 1.4 KB
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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="./katex.css">
<!-- The loading of KaTeX is deferred to speed up page rendering -->
<script type="module" src="./katex.js"></script>
<script type="module" src="./index.js"></script>
<style id="style">
</style>
</head>
<body>
<div class="regular">
<label for="inputLatex">Classic LaTeX:</label>
<textarea type="text" style="height:100px;width:200px" id="inputLatex" placeholder="Enter Classic LaTeX" onkeyup="updateOutput()">
</textarea>
<label for="inputFFL">FFL:</label>
<textarea type="text" style="height:100px;width:200px" id="inputFFL" placeholder="Enter FFL" onkeyup='updateStyle()'>
</textarea>
<p class="output" id="out1"></p>
</div>
<script>
const latex = document.getElementById('inputLatex');
const ffl = document.getElementById('inputFFL');
const output = document.getElementById('out1');
const styleOutput = document.getElementById('style');
function updateOutput() {
output.innerHTML = window.katex.renderToString(latex.value);
}
function updateStyle() {
styleOutput.innerHTML = window.katex.renderToFFL(ffl.value);
output.innerHTML = window.katex.renderToString(latex.value);
}
</script>
</body>
</html>