Hello everyone,
I kept running into small workflow needs that fall outside what the compiler is meant to do. The most common one for me was printing a document as a booklet: fold a stack of double-sided pages in half and have it read in order. That’s a page-imposition problem, so it makes sense the compiler doesn’t handle it (see e.g. typst#5092) but I still needed it, so I built a small command-line tool to sit after compilation and handle it.
typst-post works on the compiled PDF directly (or your source tree, for the packing command), using vector transformations only, nothing gets rasterized, and text layers and links stay intact.
It does four things:
-
booklet— impose pages as a 2-up saddle-stitch booklet, with sheet scaling and signature grouping for thicker bindings -
rotate— rotate individual pages or ranges by 90/180/270 degrees -
reorder— reorder, duplicate, or drop pages from a page list -
pack— zip a project together with every file it actually depends on, using the compiler’s own--depsoutput rather than guessing from source text
A booklet, for example, is just:
typst-post booklet thesis.pdf
typst-post booklet zine.pdf --sheet a4
Install with pipx install typst-post (or plain pip install). MIT licensed.
Happy to hear if this is useful to anyone else, or if there’s a related pain point worth covering next.