I want math formulas on my Hugo website, but with the following requirements:
- Light webpages: I don’t want my webpages to take long to be served.
- Javascript-free: I don’t want client-side Javascript to render the formulas, so I think it requires pre-rendering them at compile-time.
- Selectable formulas: I want the math formulas to be selectable on the browser, so I don’t want solutions that convert the math into SVG or bitmap. I know MathML, but I think that other solutions only apply CSS on HTML to style the equations.
- LaTeX “$…$” notation: I would also like to use the simple “$…$” notation for writing LaTeX in markdown, like we do in Jupyter Notebooks.
I know that client-side MathJax or KaTeX provide 4., but obviously not 2. Conversely, server-side KaTeX provides 2., but not 4. as it relies on the heavy {{< katex >}}$E=mc^2${{< /katex >}}
instead of simply $E=mc^2$
.
Is there a solution that provides the best of both worlds? I have seen this discussion, but I think that they settled on using Javascript rendering, which doesn’t suit my needs.