Mathjax v3

--------
1. update to mathjax 3
2. add scroll to long formula
This commit is contained in:
joyqat 2020-07-23 14:55:44 +08:00
parent 7b49b382f1
commit 91cf4b6be5
3 changed files with 20 additions and 39 deletions

View File

@ -1,11 +1,4 @@
code.has-jax {
font: inherit;
font-size: 100%;
background: inherit;
border: inherit;
color: #515151;
}
.MathJax {
font-size: 120% !important;
overflow-x: auto;
overflow-y: hidden;
}

View File

@ -20,7 +20,7 @@
url = "https://cdn.jsdelivr.net/npm/raphael@2.3.0/raphael.min.js"
[js.mathjax]
url = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/MathJax.js"
url = "https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js"
[js.webfont]
sri = "" # no sri

View File

@ -30,35 +30,23 @@
{{ end }}
{{ if in .Params.Libraries "mathjax" }}
<script type="text/javascript" async src="{{ $js.mathjax.url }}?config=TeX-AMS-MML_HTMLorMML">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [['$', '$'], ['\\(', '\\)']],
<script>
window.MathJax = {
tex: {
inlineMath: [['$', '$']],
displayMath: [['$$', '$$']],
processEscapes: true,
processEnvironments: true,
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
TeX: {
equationNumbers: { autoNumber: "AMS" },
extensions: ["AMSmath.js", "AMSsymbols.js"]
tags: "ams"
},
options: {
skipHtmlTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
ignoreHtmlClass: 'tex2jax_ignore',
processHtmlClass: 'tex2jax_process'
}
}
});
MathJax.Hub.Queue(function () {
// Fix <code> tags after MathJax finishes running. This is a
// hack to overcome a shortcoming of Markdown. Discussion at
// https://github.com/mojombo/jekyll/issues/199
var all = MathJax.Hub.getAllJax(), i;
for (i = 0; i < all.length; i += 1) {
all[i].SourceElement().parentNode.className += ' has-jax';
}
});
MathJax.Hub.Config({
// Autonumbering by mathjax
TeX: { equationNumbers: { autoNumber: "AMS" } }
});
};
</script>
<script async src="{{ $js.mathjax.url }}"></script>
{{ end }}
{{ if in .Params.Libraries "msc" }}