4 ms·
The commenter says pre-rendered/server-side-rendered mathematics (via katex) is great - I’ve found the opposite. It’s probably great if you have an article with
by joppy 1y ago
The commenter says pre-rendered/server-side-rendered mathematics (via katex) is great - I’ve found the opposite. It’s probably great if you have an article with one or two equations. On the other hand, if you have an article which uses mathematics pervasively, like many pure mathematics articles, it quickly becomes far more space efficient to render the mathematics on the client side. You can quickly get 200kB+ pages by pre-rendering.
- djoldman 1y agoCould you please provide an example?
- Galanwe 1y agoMy experience with dynamically rendered math has been the opposite: if you have lots of equations to render, it inevitably takes some milliseconds to render, which makes the whole content move around and shake as rendering takes places.
- Latitude7973 1y agoDid you read the article? That's what the KaTeX project specifically claims to address.
- cubefox 1y agoThe previous comment was about using KaTeX for pre-rendered equations.
- Vosporos 1y agoIt's not too late to delete this comment.
- ayhanfuat 1y agoIndeed. It was hell to navigate pages that rendered MathJax on demand. That also improved a lot though.
- blenderob 1y ago> it inevitably takes some milliseconds to render, which makes the whole content move around and shake as rendering takes places. What a boldly incorrect comment! It's like you didn't even read the first point in TFA!
- lifthrasiir 1y agoKaTeX weighs about the same if you do care about those metrics, however.
- susam 1y agoIn case anyone wants to look at actual numbers about how much KaTeX weighs for a simple mathematics page: https://news.ycombinator.com/item?id=44614133 https://news.ycombinator.com/item?id=44614133 Quoting the relevant part from that link: katex.min.css 23.6 kB katex.min.js 277.0 kB auto-render.min.js 3.7 kB KaTeX_Main-Regular.woff2 26.5 kB KaTeX_Main-Italic.woff2 16.7 kB ---------------------------------- Total Additional 347.5 kB Of course, if the page uses more symbols in various sizes, then a few more fonts files (.woff2) need to be pulled in which case the weight of KaTeX would increase a bit too. Each font file weighs between 4 kB and 28 kB.
- adastra22 1y agoIs 200kB supposed to be a lot?
- eviks 1y agoBut how is better space efficiency at this level better than worse rendering efficiency?