-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmathjax-config.js
More file actions
81 lines (79 loc) · 2.94 KB
/
Copy pathmathjax-config.js
File metadata and controls
81 lines (79 loc) · 2.94 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// MathJax configuration for the math notes
// This configuration is used to load MathJax and set up the necessary macros and options
fetch('./Mathjax.json')
.then(response => response.json())
.then(jsonArray =>
{
const macros = jsonArray;
console.log(macros);
window.MathJax =
{
startup:
{
ready: () =>
{
console.log('MathJax is loaded!');
MathJax.startup.defaultReady();
console.log('MathJax is ready!');
MathJax.startup.promise.then(() =>
{
console.log('MathJax typeset complete!');
});
}
},
menuOptions:
{
annotationTypes:
{
TeX: ['TeX', 'LaTeX', 'application/x-tex'],
ContentMathML: ['MathML-Content', 'application/mathml-content+xml'],
OpenMath: ['OpenMath']
}
},
loader: {load: ['[tex]/texhtml','[tex]/html','ui/safe']},
tex:
{
allowTexHTML: true,
packages: {'[+]': ['texhtml','html']},
macros: macros
},
options: {
safeOptions: {
allow: {
URLs: 'safe',
classes: 'safe',
cssIDs: 'safe',
styles: 'safe'
},
safeProtocols: {
http: false,
https: true,
file: true,
javascript: false,
data: false
},
safeStyles: {
color: true,
backgroundColor: true,
border: true,
cursor: true,
margin: true,
padding: true,
textShadow: true,
fontFamily: true,
fontSize: true,
fontStyle: true,
fontWeight: true,
opacity: true,
outline: true
}
}
}
};
(function () {
var script = document.createElement('script');
script.src = 'https://cdn.jsdelivr.net/npm/mathjax@4/tex-mml-chtml.js';
script.async = true;
document.head.appendChild(script);
})();
});