logoalt Hacker News

lugaolast Tuesday at 11:51 AM0 repliesview on HN

> On top of that, there is no easy way to create a template

Templates are just functions [0].

I think much of the frustration comes from typesetting being a harder problem than it seems at first. In general a typesetting system tries to abstract away how layout is recomputed depending on content.

Supporting contextual content -- cases where the content depend on other content, e.g. numbered lists, numbered figures, references, etc -- involves iterative rendering. This is evidentidly a complexity sinkhole and having a turing complete script language will bite you back when dealing with it. I recommend reding their documentation about it [1] where they explain how they propose solving this problem.

[0]: https://typst.app/docs/tutorial/making-a-template/

[1]: https://typst.app/docs/reference/context/#compiler-iteration...