add mathjax support

This commit is contained in:
Bin Zhang 2020-10-16 15:18:02 +08:00
parent c2c9e42456
commit 3fcbe790af
2 changed files with 22 additions and 0 deletions

View file

@ -5,6 +5,9 @@
using the <a href="https://github.com/koirand/pulp/">pulp</a> theme. using the <a href="https://github.com/koirand/pulp/">pulp</a> theme.
</p> </p>
</footer> </footer>
{{ if .Params.mathjax }}
{{ partial "mathjax_support.html" . }}
{{ end }}
{{- range .Site.Params.custom_js -}} {{- range .Site.Params.custom_js -}}
<script src="{{ . }}"></script> <script src="{{ . }}"></script>
{{ end }} {{ end }}

View file

@ -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>