Skip to content

Commit e940d87

Browse files
committed
MathJax v3
1 parent fde94c3 commit e940d87

File tree

3 files changed

+25
-21
lines changed

3 files changed

+25
-21
lines changed

source/_static/js/examples.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ loadExamplefromGitHub = (name, dir, editor) => {
9494
editor.getWrapperElement().style.visibility = 'hidden'
9595
document.getElementById('mdout').innerHTML = md.render(data);
9696

97-
MathJax.Hub.Queue(["Typeset", MathJax.Hub, document.getElementById('mdout')]);
98-
MathJax.Hub.Configured();
97+
MathJax.typeset();
98+
9999
showExample(viewMarkdown);
100100
}
101101

source/_static/js/mathjax-config.js

+21-17
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
1-
MathJax.Hub.Config({
2-
extensions: ["tex2jax.js"],
3-
jax: ["input/TeX", "output/HTML-CSS"],
4-
tex2jax: {
1+
window.MathJax = {
2+
tex: {
53
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
64
displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
75
processEscapes: true,
8-
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre']
9-
},
10-
"HTML-CSS": { fonts: ["TeX"] },
11-
12-
TeX: {
13-
TagSide: 'right',
14-
TagIndent: '.8em',
15-
equationNumbers: {
16-
autoNumber: 'AMS'
17-
},
18-
Macros: {
6+
tagSide: 'right',
7+
tagIndent: '.8em',
8+
tags: 'ams',
9+
macros: {
1910
R: '{\\mathbb R}',
2011
N: '{\\mathbb N}',
2112
C: '{\\mathbb C}',
@@ -89,6 +80,19 @@ MathJax.Hub.Config({
8980
bS: '{\\mathbf S}',
9081
bT: '{\\mathbf T}',
9182
bsig: '{\bmathf \\sigma}'
92-
}
83+
},
84+
autoload: {
85+
color: [],
86+
colorv2: ['color']
87+
},
88+
packages: {'[+]': ['noerrors']}
89+
},
90+
options: {
91+
skipHtmlTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
92+
ignoreHtmlClass: 'tex2jax_ignore',
93+
processHtmlClass: 'tex2jax_process'
94+
},
95+
loader: {
96+
load: ['input/asciimath', '[tex]/noerrors']
9397
}
94-
})
98+
};

source/_templates/layout.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ <h2><div id='ExampleLinkToGitHub'></div><div id='ExampleCopyButton'></div><div i
5959
<!-- Subnav -->
6060
<script async src="{{ pathto('_static/js/subnav.js', 1)}}"></script>
6161
<!-- MathJax -->
62-
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML"></script>
62+
<script src="{{ pathto('_static/js/mathjax-config.js', 1) }}"></script>
63+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/es5/tex-mml-chtml.js" id="MathJax-script"></script>
6364
<!-- Treejs -->
6465
<script src="{{ pathto('_static/js/tree.min.js', 1)}}"></script>
6566
<!-- CodeMirror -->
@@ -82,7 +83,6 @@ <h2><div id='ExampleLinkToGitHub'></div><div id='ExampleCopyButton'></div><div i
8283
<script src="{{ pathto('_static/js/buttonstrip.min.js', 1)}}"></script>
8384
<!-- Search -->
8485
<script src="{{ pathto('_static/js/examples.js', 1)}}"></script>
85-
<script src="{{ pathto('_static/js/mathjax-config.js', 1) }}"></script>
8686
<script src="{{ pathto('_static/js/lunr.js', 1) }}"></script>
8787
<script src="{{ pathto('_static/lunr/lunr_index.js', 1) }}"></script>
8888
<script src="{{ pathto('_static/lunr/lunr_index_edps.js', 1) }}"></script>

0 commit comments

Comments
 (0)