diff options
-rw-r--r-- | layouts/partials/footer.html | 3 | ||||
-rw-r--r-- | layouts/partials/mathjax_support.html | 19 |
2 files changed, 22 insertions, 0 deletions
diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index a35c5a4..c7d0f3a 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -5,6 +5,9 @@ using the <a href="https://github.com/koirand/pulp/">pulp</a> theme. </p> </footer> +{{ if .Params.mathjax }} + {{ partial "mathjax_support.html" . }} +{{ end }} {{- range .Site.Params.custom_js -}} <script src="{{ . }}"></script> {{ end }} diff --git a/layouts/partials/mathjax_support.html b/layouts/partials/mathjax_support.html new file mode 100644 index 0000000..3696d5c --- /dev/null +++ b/layouts/partials/mathjax_support.html @@ -0,0 +1,19 @@ +<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.0.1/es5/tex-mml-chtml.js"> +</script> +<script> +MathJax.Hub.Config({ + tex2jax: { + inlineMath: [['$','$'], ['\\(','\\)']], + displayMath: [['$$','$$'], ['\[','\]']], + processEscapes: true, + processEnvironments: true, + skipTags: ['script', 'noscript', 'style', 'textarea', 'pre','code'], + TeX: { + equationNumbers: { autoNumber: "AMS" }, + extensions: ["AMSmath.js", "AMSsymbols.js"] + } + } +}); +</script> |