3 ms·
How does multi-pass stuff work in Typst and specifically for instant preview? In particular, things like ToC generation, figure and formula numbering and back-
by necovek 4y ago
How does multi-pass stuff work in Typst and specifically for instant preview?
In particular, things like ToC generation, figure and formula numbering and back- and forward-referencing?
I was always intrigued by creating a TeX-like typesetting language that has similar properties, but I was always put off by having to reimplement the gist of the typesetting engine (entire box model and font support, especially math typesetting).
It'd also be nice to support more advanced data structures other than 255 registers to allow moving away from external file use in all the multi-pass processing features.
While I was heavily involved with typesetting in TeX, I mostly had my own PlainTeX macros for all of the above stuff (including syntax highlighted code listings with cross-page continuation logic), but that was 25 years ago when Unicode support was mostly very rudimentary: I don't have a need for a typesetting engine of the sort today, though I would love to switch my blog into a more semantic language with nice support for maths and programming that would allow instant print previews (and printouts) with TeX like formatting quality.
I would also love it if you open source your stuff, but I understand that you are likely trying to build a business around this too.
- laurmaedje 4y agoThese are great points. I'll try to address all of them. Multi-pass: We also do multiple passes, but thanks to comemo we can reuse most of the stuff from previous passes. The change tracking detects if a dependency on some other part of the document requires updating. This doesn't require file writing and reading; Typst has a built-in user-facing interface for these kinds of tasks. Data structures: Typst has typical data types you'd expect from a modern programming language and also typical imperative control flow like if, for, and while. What's a bit non-standard is that Typst enforces that all user-defined functions are pure (else we'd break incremental). Open Source: We do plan to open source the Typst compiler and CLI! Just not the collaborative web app.
- necovek 4y agoThanks, that sounds great! As long as the compiler and CLI are open source, I'd be happy to try out the web app at some point too!