Math formula in hugo blog
- example: sqrt of n, $\sqrt{n}$, can be written as $\sqrt{n}$
Insert math formula in hugo blog
- Usually hugo bloc does not support math formula
- Choose theme hyde as an example
- open themes–>hyde–>layouts–>partials–>hook_head_end.html, and insert following codes
<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>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML">
</script>