-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkatex.html
More file actions
64 lines (62 loc) · 2.09 KB
/
katex.html
File metadata and controls
64 lines (62 loc) · 2.09 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!-- KaTeX -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.25/dist/katex.min.css"
integrity="sha384-WcoG4HRXMzYzfCgiyfrySxx90XSl2rxY5mnVY5TwtWE6KLrArNKn0T/mOgNL0Mmi" crossorigin="anonymous">
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.25/dist/katex.min.js"
integrity="sha384-J+9dG2KMoiR9hqcFao0IBLwxt6zpcyN68IgwzsCSkbreXUjmNVRhPFTssqdSGjwQ" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.25/dist/contrib/auto-render.min.js"
integrity="sha384-hCXGrW6PitJEwbkoStFjeJxv+fSOOQKOPbJxSfM6G5sWZjAyWhXiTIIAmQqnlLlh" crossorigin="anonymous"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
const macros = {};
let to_do = [];
for (let e of document.getElementsByTagName("code")) {
if (e.parentNode.classList.contains("language-gdef")) {
to_do.push(function () {
let x = document.createElement('span');
e.parentNode.parentNode.remove();
katex.render(e.innerText, x, {displayMode: true, throwOnError: true, macros});
});
} else if (e.parentNode.classList.contains("language-math")) {
to_do.push(function () {
let x = document.createElement('span');
e.parentNode.appendChild(x);
katex.render(e.innerText, x, {displayMode: true, throwOnError: true, macros});
});
} else {
let n = e.nextSibling;
let p = e.previousSibling;
if (n && p && /^\$/.test(n.data) && /\$$/.test(p.data)) {
to_do.push(function () {
let n = e.nextSibling;
let p = e.previousSibling;
let x = document.createElement('span');
katex.render(e.innerText, x, {throwOnError: true, macros});
e.parentNode.replaceChild(x, e);
n.splitText(1);
n.remove();
p.splitText(p.data.length - 1).remove();
});
}
}
}
for (let f of to_do) f();
});
</script>
<style>
.docblock > p {
overflow-x: visible !important;
}
.katex {
font-size: 1.0em !important;
}
.language-inline-math {
background-color: transparent !important;
}
.language-math {
background-color: transparent !important;
}
.language-math > code {
display: none !important;
}
</style>
<!-- KaTeX -->