imfing / hextra

🔯 Modern, batteries-included Hugo theme for creating beautiful doc, blog and static websites
https://imfing.github.io/hextra/
MIT License
614 stars 147 forks source link

[Feature request] Allow to use MathJax instead of KaTex #467

Open CHN-beta opened 3 days ago

CHN-beta commented 3 days ago

Feature Description

MathJax is another widely used library for rendering LaTeX in the browser. It supports a wider range of LaTeX commands than KaTeX, such as physics package (which is useful in physics and engineering), with the trade-off of being more resource-intensive. It is a good idea to support both libraries, so that users can choose the one that best fits their needs.

Problem/Solution

Add an option to choose between KaTeX and MathJax for rendering LaTeX in the browser.

Integrate MathJax into hugo site seems not very hard, see hugo official doc and mathjax official doc. Sadly I am not familiar with javascript and hugo development, so I can't provide a PR for this feature.

Additional Context

MathJax seems to be usually running on the client side, but KaTeX seems usually running on the server side. I am not sure if this makes any difficulty to integrate MathJax into hextra.