Re:Using eqn for static website equation generation
by elashri on Saturday February 01, 2025 @03:51PM
(#42902140)
If you want to render LaTeX without JS and converting files to SVG. There are two options in my experience (Anyone feel free to correct me or add another option)
1- Rely on MathJS or KeTeX to render server side. Svat comment contains links to docs.
2- Hugo can use Pandoc as a Markdown renderer, which allows you to write LaTeX equations inside Markdown and convert them to pure HTML during build time. It would give MathML code.
Another option would be use tex4ht but this is actually more used to convert whole LaTeX documents to HTML and would need to manually insert the parts you want into hugo source.
1- Rely on MathJS or KeTeX to render server side. Svat comment contains links to docs.
2- Hugo can use Pandoc as a Markdown renderer, which allows you to write LaTeX equations inside Markdown and convert them to pure HTML during build time. It would give MathML code.
Another option would be use tex4ht but this is actually more used to convert whole LaTeX documents to HTML and would need to manually insert the parts you want into hugo source.