RaTeX: KaTeX-compatible LaTeX rendering engine in pure Rust
3 days ago
- #LaTeX-math-rendering
- #WebAssembly
- #Rust
- RaTeX parses LaTeX math and outputs a flat display list compatible with various vector backends, providing identical output from native FFI and WebAssembly.
- It is built to match KaTeX in critical areas, validated via CI golden suites with pixel diff comparisons.
- Targets include native apps, servers, and embedded systems without a WebView, enabling uniform math rendering across platforms.
- Offers ready-to-use SDKs and WASM builds via npm, Maven, pub.dev, and SPM, with server-side PNG and CLI support.
- Features include built-in mhchem-style chemistry support for \ce and \pu macros alongside ordinary math.
- Rust core ensures predictable timing and no garbage collection in the hot path, suitable for mobile UIs and servers.
- Differences from WebView-based solutions: avoids JavaScript bundles, uses predictable memory, and supports offline usage.
- Advantages over native math SDKs include cross-platform engine consistency, chemistry macros, and TeX layout core in Rust.