typst-post
Post-compilation utilities for Typst documents: booklet imposition, page rotation, page reordering, and project packing.
Typst deliberately keeps its compiler focused on producing documents, so workflow requests like rotating a single page (typst#5559), rearranging output (typst#332), booklet printing (typst#5092), or bundling a project with its assets (typst#579) are closed as out of scope. typst-post picks up where the compiler stops. It operates on the compiled PDF (or the source tree), never on your markup, and every transformation is a pure vector operation — nothing is rasterized.
The PDF commands work on any PDF, not just Typst output.
Installation
pipx install typst-post
or pip install typst-post. Requires Python 3.9+. The pack command
additionally needs the typst CLI on your PATH.
Usage
booklet
Impose pages as a 2-up saddle-stitch booklet: print the result double-sided (flip on short edge), fold the stack in half, and it reads in order.
typst-post booklet thesis.pdf
typst-post booklet zine.pdf --sheet a4
typst-post booklet book.pdf --signature 16
By default each output spread is exactly twice the input page width, so an A5
document becomes A4 spreads with no scaling. --sheet scales and centers the
spreads onto a named size (a3, a4, a5, letter, legal) instead. --signature
splits the document into folded signatures of N pages (a multiple of 4) for
thicker, bound booklets.
--layout 4up imposes four pages per side instead of two: each physical
sheet becomes an independent 8-page signature (two perpendicular folds),
with signatures gathered and bound together. Requires --signature to be a
multiple of 8.
typst-post booklet chapbook.pdf --layout 4up --signature 16
The 4-up page/rotation layout was verified against a real imposition example generously shared by John Blommers.
rotate
Rotate individual pages by multiples of 90 degrees.
typst-post rotate scans.pdf 2:180
typst-post rotate deck.pdf 5-8:90 12:180
typst-post rotate doc.pdf all:180
reorder
Reorder, duplicate, or drop pages with a page list. Ranges may run backwards.
typst-post reorder doc.pdf 4,1,2,3
typst-post reorder doc.pdf 1-3,8-5 # keep 1-3, then 8..5 reversed
typst-post reorder doc.pdf 1,3,5,7 # drop the even pages
pack
Zip a Typst project together with every file it actually depends on — images,
imported files, fonts loaded from the tree — ready to hand to a co-author or
print shop. The dependency list comes from the compiler itself
(typst compile --deps, falling back to --make-deps on older versions), so
nothing is guessed from the source text.
typst-post pack main.typ
typst-post pack main.typ -o handoff.zip --with-pdf
Files outside the project root (such as the package cache) are skipped, since Typst restores packages on its own.
Roadmap
- Creep compensation and inner margins for thick booklets
- Watch hooks: re-run any of the above on
typst watchrecompiles (typst#3362)
License
MIT
Release files for typst-post 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| typst_post-0.2.0.tar.gz | 11.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| typst_post-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.8 kB
Release files / typst_post-0.2.0.tar.gz
| Download URL | typst_post-0.2.0.tar.gz |
|---|---|
| Size | 11.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1839fa7d67de13862a03370ed68fddae7a46da266d7a8ab5eefc273946bdaf90
|
|
BLAKE2b-256 checksum How to use checksums |
e63fe33651f63d670f784f8992b08471ad85b9bafea0cc569a509866ca88f714
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.9
|
Release files / typst_post-0.2.0-py3-none-any.whl
| Download URL | typst_post-0.2.0-py3-none-any.whl |
|---|---|
| Size | 12.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8f0bf415bb2c9814ec272de0d427016351752c822237eb5ca1a7a951f27a8a5b
|
|
BLAKE2b-256 checksum How to use checksums |
75efc31098528c4a0b9d5c450fe12ba8067e8564ba6be63be5c8cdb257bb46e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.9
|