Add mathjax support
This commit is contained in:
parent
d4fc55a757
commit
0374aa92bf
@ -76,6 +76,13 @@ code {
|
|||||||
background: black;
|
background: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
code.has-jax {
|
||||||
|
-webkit-font-smoothing: antialiased;
|
||||||
|
background: inherit !important;
|
||||||
|
border: none !important;
|
||||||
|
font-size: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
blockquote {
|
blockquote {
|
||||||
font-style: italic;
|
font-style: italic;
|
||||||
border: thin solid black;
|
border: thin solid black;
|
||||||
|
@ -17,4 +17,5 @@
|
|||||||
{{ $sass := resources.Get "css/main.scss" }}
|
{{ $sass := resources.Get "css/main.scss" }}
|
||||||
{{ $style := $sass | resources.ToCSS $options }}
|
{{ $style := $sass | resources.ToCSS $options }}
|
||||||
<link rel="stylesheet" href="{{ $style.Permalink | relURL }}" />
|
<link rel="stylesheet" href="{{ $style.Permalink | relURL }}" />
|
||||||
|
{{ if .Params.mathjax }} {{ partial "mathjax.html" . }} {{ end }}
|
||||||
</head>
|
</head>
|
21
layouts/partials/mathjax.html
Normal file
21
layouts/partials/mathjax.html
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
<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 id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
|
Loading…
x
Reference in New Issue
Block a user