Merge pull request #307 from joyqat/mathjax-v3-fix-scroll

Update to Mathjax v3, add x-scroll to long formula
This commit is contained in:
zzossig 2020-07-24 13:40:19 +09:00 committed by GitHub
commit 2b9fc0a292
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 39 deletions

View File

@ -1,11 +1,5 @@
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;
box-sizing: border-box;
}

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,27 @@
{{ 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: [['$', '$'], ['\\(', '\\)']],
displayMath: [['$$', '$$']],
processEscapes: true,
processEnvironments: true,
skipTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
TeX: {
equationNumbers: { autoNumber: "AMS" },
extensions: ["AMSmath.js", "AMSsymbols.js"]
}
}
});
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>
window.MathJax = {
tex: {
inlineMath: [['$', '$']],
displayMath: [['$$', '$$']],
processEscapes: true,
processEnvironments: true,
tags: "ams"
},
chtml: {
scale: 1.1
},
options: {
skipHtmlTags: ['script', 'noscript', 'style', 'textarea', 'pre'],
ignoreHtmlClass: 'tex2jax_ignore',
processHtmlClass: 'tex2jax_process'
}
};
</script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script async src="{{ $js.mathjax.url }}"></script>
{{ end }}
{{ if in .Params.Libraries "msc" }}