top | item 41984646

(no title)

mgt19937 | 1 year ago

Cool project! I like the idea of easily sharing LaTeX formulas. It's impressive how smooth it works right in the browser.

I've always thought compiling LaTeX in WebAssembly would be a tough nut to crack, so I was curious if that's what you'd done here. Turns out you're using KaTeX.

Have you considered any WebAssembly approaches?

discuss

order

Wdorf|1 year ago

Thank you for your positive feedback.

KaTeX does not support all LaTeX features but initializes very quickly.

LaTeX via WebAssembly supports more features but might need longer to initialize.

There's an existing WebAssembly project: https://www.swiftlatex.com

red_trumpet|1 year ago

There is TikZJax[1], which apparently compiles TeX to WebAssembly, to run TikZ in the browser.

[1] https://tikzjax.com/

dunham|1 year ago

I played with web2js a couple of years ago. TeX ends up being a 500kb WASM file (88kb gzipped).

The LaTeX format file or the memory image after LaTeX is loaded are a bit bigger though (2.3 MB and 6.3MB gzipped, respectively).

jszymborski|1 year ago

Not OP, but do you mind me asking what advantages you hope to achieve by using WebAssembly rather than KaTeX?

trurl42|1 year ago

Well, for one, KaTeX doesn't do "LaTeX" but a limited subset of the TeX equation syntax. As such, it can't handle more complicated macros or typesetting anything apart from equations.