Real-Time LuaTeX: Recompiling Large Documents in 1ms
Real-Time LuaTeX: Recompiling Large Documents in 1ms [pdf]
I demonstrate that pixel-perfect LaTeX output and real-time editing are not mutually exclusive. By extracting display lists directly from LuaTeX's node structures, I achieve sub-millisecond recompilation for single paragraphs using vanilla TeX Live. This approach powers texlode, a browser-based tool that offers constant latency regardless of document size, proving that full compilation is unnecessary during the editing loop.
The question this paper addresses is not how to make LuaTeX faster, but whether full compilation is even necessary during editing.
- froh
the purpose (from the paper):
> texlode, the browser-based book editor built
on this architecture, is scheduled for public release in
October 2026. It provides collaborative editing via
conflict-free replicated data types (CRDTs), manu-
script import from Word, proceedings management,
cover design tools, and print-ready PDF output iden-
tical to standard LuaLATEX. The accompanying con-
ference talk demonstrates the editor in action. For
details: texlode.com.
and also:
> (section) 6 Comparison to Typst
- gucci-on-fleek
This was presented earlier today, and you can view the recorded video at [0].
[0]: https://www.youtube.com/live/6riWbnT0grs?si=zIePpHrC6TEZpc_I... (starts at 2:52:46) [1]
[1]: Once the conference is over, I'll separate each presentation out into separate videos, but I'm busy at the moment with filming the current presentations :).
- VorpalWay
> Benchmarks show that per-paragraph recompilation achieves O(1) latency, constant regardless of document size, whereas Typst’s [3] incremental compilation scales linearly (O(n)).
> The tradeoff is temporary inconsistency: pages the user is not viewing may lag until a background
compile converges, [...]
There doesn't seem to be any reason functionality like this couldn't also be added to Typst though. In general the authors of this paper seem dismissive of typst, but Typst also fixes so many other things about LaTeX, like the awful syntax. Not sure why they act like that.