Post-compilation utilities for Typst: booklet imposition, page rotation, reordering, and project packing.
Project description
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.
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
- n-up imposition beyond 2-up
- Watch hooks: re-run any of the above on
typst watchrecompiles (typst#3362)
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file typst_post-0.1.1.tar.gz.
File metadata
- Download URL: typst_post-0.1.1.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da479dc2fb3d431a349a30dc097ba75b6d448ac8781a1db4132a33c53b9b731b
|
|
| MD5 |
20710bd58f733d7ccfdb6220c2c8db4d
|
|
| BLAKE2b-256 |
7b8d7e9168af3620530dc1f5f41d83670e6249117def9210fa334196440a4a35
|
File details
Details for the file typst_post-0.1.1-py3-none-any.whl.
File metadata
- Download URL: typst_post-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d9b93497bc5bc7e1d59ccc6b630e64b57e30f3d4b0509462f3174a5212603d8c
|
|
| MD5 |
b362fd3846e21483610bbc5d4885e8e7
|
|
| BLAKE2b-256 |
27538784ddbb6d96e100f67b42f11fda7b7001c9612311dd585f5b9d42a6c51f
|