A 1,100-page family history book in Typst

I’ve been using Typst to typeset a family history, and it turned into a tool other people can use, so I’ve open-sourced it.

The book it was built for is 1,123 pages, with about 3,000 footnotes and a two-column name index. A Python script reads the family tree (a GEDCOM file) and writes one big .typ file, then Typst compiles it. The stories use a small subset of Typst markup, with a #src("key") function for citations that turns into footnotes. After compiling, it runs typst query to check that footnotes land where they should.

If you pin SOURCE_DATE_EPOCH, the PDF comes out byte-for-byte the same every time.

Sample book (a made-up family, 57 pages): https://flyleaf.family/sample-book.pdf
Code: GitHub - ian-c-leonard/flyleaf: Turn a family tree (GEDCOM) into a printed family history and a family website. · GitHub

Happy to answer questions about the templates.

3 Likes

What is this for? Did typst have problems placing the footnotes the right way?

Yes, now and then. It’s this one: Footnote precedes a reference to it · Issue #5314 · typst/typst · GitHub. Sometimes a footnote ends up at the bottom of the page before the line that cites it, usually when the paragraph gets pushed onto the next page. In a book this long it happened a handful of times, and it’s easy to miss when you’re proofreading 1,100 pages.

So after compiling, the build uses typst query to get the page of each footnote and the page of its marker, and stops if a footnote comes first. The fix is usually to keep that paragraph together. It also warns about a page that holds nothing but the tail end of a footnote from the page before.