-
Notifications
You must be signed in to change notification settings - Fork 107
/
custom-component.js
61 lines (54 loc) · 1.84 KB
/
custom-component.js
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
//
// Initialize the MathJax startup code
//
require('mathjax-full/components/src/startup/lib/startup.js');
//
// Get the loader module and indicate the modules that
// will be loaded by hand below
//
const {Loader} = require('mathjax-full/js/components/loader.js');
Loader.preLoad(
'loader', 'startup',
'core',
'input/tex-base',
'[tex]/ams',
'[tex]/newcommand',
'[tex]/configmacros',
'[tex]/action',
'output/chtml', 'output/chtml/fonts/tex.js',
'ui/menu'
);
//
// Update the configuration to include any needed values
// (we set the mathjax path explicitly, since it defaults
// to the location from which this file is loaded)
//
const {insert} = require('mathjax-full/js/util/Options.js');
insert(MathJax.config, {
loader: {
paths: {
mathjax: 'https://cdn.jsdelivr.net/npm/mathjax@3/es5'
}
},
tex: {
packages: {'[+]': ['ams', 'newcommand', 'configmacros', 'action']}
}
}, false);
//
// Load the components that we want to combine into one component
// (the ones listed in the preLoad() call above)
//
require('mathjax-full/components/src/core/core.js');
require('mathjax-full/components/src/input/tex-base/tex-base.js');
require('mathjax-full/components/src/input/tex/extensions/ams/ams.js');
require('mathjax-full/components/src/input/tex/extensions/newcommand/newcommand.js');
require('mathjax-full/components/src/input/tex/extensions/configmacros/configmacros.js');
require('mathjax-full/components/src/input/tex/extensions/action/action.js');
require('mathjax-full/components/src/output/chtml/chtml.js');
require('mathjax-full/components/src/output/chtml/fonts/tex/tex.js');
require('mathjax-full/components/src/ui/menu/menu.js');
//
// Loading this component will cause all the normal startup
// operations to be performed when this component is loaded
//
require('mathjax-full/components/src/startup/startup.js');