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 | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | awoo | 154 |
8 | Dominater069 | 154 |
10 | nor | 150 |
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.