Hacker News new | ask | show | jobs
by doerig 2219 days ago
Honestly, I really don't know. MathJax has been very janky for some reason. I have tried using KaTeX (https://katex.org) but couldn't get it to work properly and some equations just looked "off".
1 comments

I had to give up on both: they seem great until your page needs more than 10 formulae and it starts to take quite a lot of seconds for your page to finish loading for folks. Instead I switched to preprocessing my pages to extract latexy blocks, literally run them through latex and pdf2svg to turn them into clean SVG image and replace the on-page latex code with presized <svg> elements: now your content doesn't jump around while loading (because the browser already knows how much space the image will take up), everyone sees the same thing (no browser quirks around MathML etc) and because it's SVG, positioning and scaling is trivial.
That's actually pretty cool. Do you have an automated setup to do that, or is it manual for every "post"?
I could trivially automate it so that it runs as part of CI/CD, but that's honestly more work than just running `npm run build` ever time I write a new chapter.
If you use next.js with eg. katex this will happen by default.
Do you have a repo by any chance?
I have many, many repos, but in this case we're talking https://github.com/pomax/Bezierinfo-2