top | item 45797268

(no title)

joppy | 3 months 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.

discuss

order

Galanwe|3 months ago

My 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.

ayhanfuat|3 months ago

Indeed. It was hell to navigate pages that rendered MathJax on demand. That also improved a lot though.

blenderob|3 months 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!

Latitude7973|3 months ago

Did you read the article? That's what the KaTeX project specifically claims to address.

Vosporos|3 months ago

It's not too late to delete this comment.

lifthrasiir|3 months ago

KaTeX weighs about the same if you do care about those metrics, however.

susam|3 months ago

In 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

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.

eviks|3 months ago

But how is better space efficiency at this level better than worse rendering efficiency?

djoldman|3 months ago

Could you please provide an example?

adastra22|3 months ago

Is 200kB supposed to be a lot?