mirror of
https://github.com/MeiK2333/github-style.git
synced 2025-10-07 10:04:04 +00:00
feat: you can use MathJax now
This commit is contained in:
@@ -131,6 +131,12 @@ display block $$ ... $$
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
## Support MathJax
|
||||||
|
you can add MathJax:true to frontmatter
|
||||||
|
|
||||||
|
```
|
||||||
|
mathJax: true
|
||||||
|
```
|
||||||
## config.toml example
|
## config.toml example
|
||||||
|
|
||||||
```toml
|
```toml
|
||||||
|
@@ -8,3 +8,41 @@
|
|||||||
integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous"
|
integrity="sha384-kWPLUVMOks5AQFrykwIup5lo0m3iMkkHrD0uJ4H5cjeGihAutqP0yW0J6dpFiVkI" crossorigin="anonymous"
|
||||||
onload="renderMathInElement(document.body);"></script>
|
onload="renderMathInElement(document.body);"></script>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
{{ if or .Params.MathJax .Site.Params.MathJax}}
|
||||||
|
<script type="text/javascript" async
|
||||||
|
src="https://cdn.bootcss.com/mathjax/2.7.3/MathJax.js?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';
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
code.has-jax {
|
||||||
|
font: inherit;
|
||||||
|
font-size: 100%;
|
||||||
|
background: inherit;
|
||||||
|
border: inherit;
|
||||||
|
color: #515151;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
{{end}}
|
Reference in New Issue
Block a user