Skip to content

Commit

Permalink
bump
Browse files Browse the repository at this point in the history
  • Loading branch information
kabachook committed May 6, 2022
1 parent 8d5ea12 commit 40cfe20
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 21 deletions.
31 changes: 12 additions & 19 deletions ecc/static/tex.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
window.MathJax = {
tex: {
inlineMath: [["\\(", "\\)"]],
displayMath: [["\\[", "\\]"]],
processEscapes: true,
processEnvironments: true
},
options: {
ignoreHtmlClass: 'tex2jax_ignore',
processHtmlClass: 'tex2jax_process',
renderActions: {
find: [10, function (doc) {
for (const node of document.querySelectorAll('script[type^="math/tex"]')) {
const display = !!node.type.match(/; *mode=display/);
const math = new doc.options.MathItem(node.textContent, doc.inputJax[0], display);
const text = document.createTextNode('');
const sibling = node.previousElementSibling;
node.parentNode.replaceChild(text, node);
math.start = {node: text, delim: '', n: 0};
math.end = {node: text, delim: '', n: 0};
doc.math.push(math);
if (sibling && sibling.matches('.MathJax_Preview')) {
sibling.parentNode.removeChild(sibling);
}
}
}, '']
}
ignoreHtmlClass: ".*|",
processHtmlClass: "arithmatex"
}
};

document$.subscribe(() => {
MathJax.typesetPromise()
})
4 changes: 2 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ markdown_extensions:
- admonition
- toc:
permalink: true
- pymdownx.arithmatex
- pymdownx.arithmatex:
generic: true
- pymdownx.betterem:
smart_enable: all
- pymdownx.caret
Expand All @@ -36,7 +37,6 @@ markdown_extensions:

extra_javascript:
- 'static/tex.js'
- 'https://polyfill.io/v3/polyfill.min.js?features=es6'
- 'https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js'
extra_css:
- 'static/style.css'
Expand Down

0 comments on commit 40cfe20

Please sign in to comment.