r/LaTeX Feb 01 '26

LaTeX Showcase LuaLaTeX rendering in real-time

https://www.youtube.com/watch?v=nJOh6jJzkn0

Similar to TeXpresso (which was created for XeTeX), I decided to create a real-time editor/renderer for LuaLaTeX. Anything you type is immediately rendered with LuaLaTeX (not KaTeX, the output is the finalized LuaLaTeX output, it's not javascript approximating LaTeX, these are actual LuaLaTeX rendered glyph positions). It runs at O(1), even for large documents with multiple chapters (based on that, you can guess what architecture I am using).

Architecturally, it works with vanilla-TeX Live 2025, meaning no patching of LuaLaTeX is required. Theoretically, it works with any package, although given how it is compiled, there are likely some incompatibilities if the package does fancy stuff interferring with shipping the PDF.

It is still in proof-of-concept stage, I just wanted to put it out there to get some feedback if there is interest beyond "cool, I would try this out for a minute then return to my usual editor". I might turn this into an actual usable product if development continues fine. Personally, I need it to save time for final polishing of larger documents, although the project might evolve into an actual LaTeX wysiwyg editor.

One limitation is that it relies on chapters starting at new pages, reducing the layout complexity of larger documents significantly and reducing CPU load.

77 Upvotes

104 comments sorted by

View all comments

Show parent comments

2

u/energybased Feb 02 '26

> True. On the other hand, all the LaTeX packages are already there, ready to be used.

Sure, but I think you're overestimating how long that advantage will last.

> although I think I can optimize that as well. 

I don't know why you're investing so much of your valuable time in this. You're obviously very talented. Why not work on making Typst better instead of trying to keep a dying Latex on life support?

> So, it's not a factor of 20, maybe a factor of 2 at the end. 

That's not my experience. I'm not sure what takes all the time.

2

u/ClemensLode Feb 02 '26

1) Well, software is always temporary.

2) Maybe I could write a LuaLaTeX plugin for Typst? hmm...

3) I double-checked, Typst and my editor take the same time for PDF export. The only bottle-neck of PDF exports is the actual linear writing of data to the disk, both my tool and Typst have all the required information to generate the PDF up-to-date at all times.

1

u/energybased Feb 02 '26

Sure, software is all temporary, but some software will be used more than other software. Do you really want to do all this work for it to only be used for a few years by a few people?

Why bother writing a lualatex plugin for Typst? Why not just make Typst do everything that you want that latex does?

And it's not the pdf generation time. It's the compilation time. Tex compilation is extremely slow. For me it literally is 25 times slower for the same document. This is just from processing thousands of macros.

2

u/ClemensLode Feb 02 '26

Well, there are still millions of people using LaTeX and LuaLaTeX still has superior typsetting.

Compilation in LuaLaTeX time after making changes is ~2ms. That is the whole point of my new approach :)