feat: add rendered math support with mathjax

This commit is contained in:
Ari Kalfus
2022-12-09 17:06:38 -05:00
committed by GitHub
parent 5921485a10
commit bedb8ba1ca
3 changed files with 57 additions and 1 deletions
+22 -1
View File
@@ -65,4 +65,25 @@
{{ if not (.Site.Params.navbar.disableSearch | default false) }}
<script src="/js/search.js"></script>
{{ end }}
{{ end }}
{{ if (.Params.mathjax | default false) }}
{{ "<!-- MathJax -->" | safeHTML }}
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.2.2/es5/tex-mml-chtml.min.js" integrity="sha384-M5jmNxKC9EVnuqeMwRHvFuYUE8Hhp0TgBruj/GZRkYtiMrCRgH7yvv5KY+Owi7TW" crossorigin="anonymous"></script>
<script type="text/x-mathjax-config">
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"] }
}
});
</script>
{{ end }}