Merge pull request #79 from binzhang-u5f6c/master

add mathjax support
This commit is contained in:
Kazuki Koide 2020-11-01 21:24:31 +09:00 committed by GitHub
commit e82a480e45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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>