24 Booklets
I have an Epson M1170 ink-tank printer that needs weekly or fortnightly use, otherwise the ink dries out and other weird things happen. You have to print something. So instead of wasting paper on test pages, I've been printing story booklets: 3-4 A4 sheets of Sanskrit Chandamama stories typeset with Typst. But doing that week after week is a chore I never got around to automating. Until now, that is.
I spent a couple of hours today guiding an LLM to build exactly what I wanted. The result is Booklets.
The source:
# संस्कृत चन्दमामा --- जनवरी १९९१
## चीनांशुकम्
द्वित्रसहस्रवर्षेभ्यः पूर्वं चीनादेशे कश्चन राजा आसीत्। तस्य पत्न्याः नाम चीलिंग्षी इति। सा परमसुन्दरी। विवाहसमये तस्याः वयः चतुर्दश वर्षाणि।
...
The profile:
body-font: Eczar
heading-font: Eczar
lang: sa
fontsize: 10pt
numbering: deva
rotate: 0
The command:
booklets -p cm199101.profile cm199101.md
The output: book-a4-booklet.pdf.
The application uses a custom Markdown parser and a combination of typst and pdfimpose to produce the output.