RaTeX: KaTeX-compatible LaTeX rendering engine in pure Rust

· web devtools · Source ↗

TLDR

  • Pure Rust LaTeX math layout engine emitting a flat display list for native, WASM, iOS, Android, Flutter, and React Native from one core.

Key Takeaways

  • Single Rust core targets C ABI (Swift, Kotlin, Dart FFI), WASM, and server-side PNG/CLI with identical display list output.
  • CI runs pixel-diff golden suites against KaTeX reference images; a public support table shows side-by-side coverage.
  • Zero JS bundle overhead vs KaTeX (~280 kB) or MathJax (~500 kB); no GC in the hot path means predictable timing on mobile.
  • Built-in mhchem-style \ce and \pu chemistry/units macros ship in the same pipeline, unlike swiftMath, flutter_math, or iosMath.
  • Packages distributed via npm (ratex-wasm, ratex-react-native), Maven, pub.dev, and Swift Package Manager.

Hacker News Comment Review

  • Commenters flagged that the landing page omits binary size for mobile bundles and performance numbers, both critical for evaluating the “no WebView” pitch.
  • The “0 kB JS bundle” claim drew skepticism: KaTeX and MathJax already support SVG output in Node without a browser, narrowing the stated advantage.
  • Accessibility is an open gap: the live demo ships no alt text or ARIA labels, a regression from MathML-tagged PDFs and KaTeX’s built-in MathML accessibility path.

Notable Comments

  • @azverev: praises pixel-diff CI as rare discipline, asks how font fallbacks are handled across platforms sharing the same Rust core.
  • @tabbott: notes LLM-assisted copy erodes trust and flags missing binary-size and maintenance-signal details before Zulip integration could be considered.

Original | Discuss on HN