Add support for MathJax
This commit is contained in:
parent
769fbb55e3
commit
8aac26a42b
3 changed files with 31 additions and 0 deletions
|
@ -13,4 +13,6 @@
|
|||
<nav></nav>
|
||||
{{ end }}
|
||||
|
||||
{{ if .Site.Params.mathjax }}{{ partial "mathjax_support.html" . }}{{ end }}
|
||||
|
||||
{{ partial "header-extra.html" . }}
|
||||
|
|
22
layouts/partials/mathjax_support.html
Normal file
22
layouts/partials/mathjax_support.html
Normal file
|
@ -0,0 +1,22 @@
|
|||
<script>
|
||||
MathJax = {
|
||||
tex: {
|
||||
inlineMath: [['$', '$'], ['\\(', '\\)']],
|
||||
displayMath: [['$$','$$'], ['\\[', '\\]']],
|
||||
processEscapes: true,
|
||||
processEnvironments: true
|
||||
},
|
||||
options: {
|
||||
skipHtmlTags: ['script', 'noscript', 'style', 'textarea', 'pre']
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener('load', (event) => {
|
||||
document.querySelectorAll("mjx-container").forEach(function(x){
|
||||
x.parentElement.classList += 'has-jax'})
|
||||
});
|
||||
|
||||
</script>
|
||||
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
|
||||
<script type="text/javascript" id="MathJax-script" async
|
||||
src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
|
Loading…
Add table
Add a link
Reference in a new issue