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?
# | User | Rating |
---|---|---|
1 | tourist | 3993 |
2 | jiangly | 3743 |
3 | orzdevinwang | 3707 |
4 | Radewoosh | 3627 |
5 | jqdai0815 | 3620 |
6 | Benq | 3564 |
7 | Kevin114514 | 3443 |
8 | ksun48 | 3434 |
9 | Rewinding | 3397 |
10 | Um_nik | 3396 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | Um_nik | 163 |
3 | maomao90 | 162 |
3 | atcoder_official | 162 |
5 | adamant | 159 |
6 | -is-this-fft- | 158 |
7 | awoo | 155 |
8 | TheScrasse | 154 |
9 | Dominater069 | 153 |
10 | nor | 152 |
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?
Name |
---|
(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.