kevinraymond/florilegium

Media & Design

Generate Delft-blue floral page margins for LaTeX documents, drawn procedurally in Lua.

460
11
Lua
MIT
new today

Florilegium is a LaTeX package and PostScript file that draw ornamental floral margins — petals, leaves, stems, insects — directly into a PDF, with no images or imported paths. It suits LaTeX authors who want decorative title pages, books or articles in the style of hand-painted Delft-blue margins, and who are comfortable compiling with LuaLaTeX.

What you get

Two compositions share one package. The authored version places stems, leaves and flowers by hand, tuned for A4 with a 68 mm margin, and does not adapt. The grown version uses a greedy space-filling loop: it takes the largest free disc near a stem, picks a motif that fits, grows a branch to it, and repeats — so the garden occupies whatever space the text leaves, including the area below a short final page. Every page is seeded from its page number, so page n always produces the same garden; that determinism is what makes the output stable to typeset.

The palette derives from a single ink colour via an OKLCH ramp, so one setting yields Delft blue, sepia, green and other hues. Optional features tied to the grown margin include decorative initials built from an OpenType glyph outline, flowers beside numbered headings, \florilegiumbloom for a flower placed where the text asks, and an aging option that shifts from spring buds to autumn seed heads. Visitors (butterflies, bees, a snail, occasionally a bird) can be switched off.

Running it

The main path is LuaLaTeX, one pass, about a second per page; the seasons option needs two passes because it uses the page count. The README documents a normal make build, a Docker container for machines without TeX, and an Overleaf route where you paste the .sty, six .lua files and a .tex file and set the compiler to LuaLaTeX. Gallery and animation targets need extra tools (python3, Pillow, pdftoppm, ffmpeg). A fixed seed can be set at compile time instead of deriving it from the page number.

A separate PostScript build produces a self-contained two-page file runnable under Ghostscript with no TeX. It is largely a procedure-by-procedure port, but seed values do not match the Lua version, and it has no initials, animation or authored composition. Transparency in PostScript needs Ghostscript's -dALLOWPSTRANSPARENCY; on a printer each translucent fill is mixed and painted opaque, so prints look flatter.

Fit and limits

This is a document-design tool, not a general illustration library, though individual primitives can be drawn inside TikZ scopes with the current shift, rotation and scale. The authored layout is fixed; only the grown version adapts to layout. The reproduction targets A4 with a 68 mm margin. The project is MIT licensed. Hacker News readers discussed the idea and the PDF animation technique in 2026 (discussion); a commenter pointed to an earlier procedural decoration project for a LaTeX edition of Byrne's Elements of Euclid (comment).

Written by AI from the project's README, updated October 30, 2026. The project's own docs are the source of truth.

Hacker News

Florilegium: Procedural Flowers in LaTeX
▲ 115 · 20 comments · October 30, 2026