lolkekaidarbek's blog

By lolkekaidarbek, history, 14 months ago, In English

Hello, CodeForces!

I've been wondering for a long time, how CodeForces and Polygon convert LaTeX to HTML? What utils does it use? MikeMirzayanov, geranazavr555, could you share it with us?

  • Vote: I like it
  • +14
  • Vote: I do not like it

14 months ago, # |
Rev. 3   Vote: I like it +20 Vote: I do not like it

(I'm not CodeForces staff, but I know a lot about web publishing.)

Most of the web uses KaTeX. Those who hasn't switched to it use MathJax, it's older and slightly slower alternative — including CodeForces (by the way, if some black-colored handles are reading this, please consider upgrading: it is a drop-in replacement that will make a sizeable portion of pages load 2x faster). They both work by including an autoloading script and wrapping all the math formulas with dollar signs, and then JavaScript does its magic.

You could in theory do server-side math rendering, and this is probably how it should be done to optimize both page size and client performance, but I've never seen anyone implementing this — perhaps because the intersection of JavaScript developers and heavy TeX users is too narrow.

If what you really ask is how to put something written in LaTeX on the web, pandoc is generally enough for most use cases.