LockerGnomeTech news and nostalgia for today's technology professionals
Subscribe

Search

Softwarelatexlualatexgenerative-arttypographyopen-sourcepdf

Florilegium Grows a Different Delft-Blue Flower Border on Every LuaLaTeX Page From Math Alone, Snails and Bees Included

Kevin Raymond's MIT-licensed florilegium package paints watercolor floral margins in Lua while TeX typesets the page: no images, no imported paths, and page n always gets garden n. It started as an answer to a Reddit question.

Chris Pirillo painted on a glazed blue-and-white majolica tile, reading a tall page whose margin is overgrown with blue flowers, a snail and a butterfly
Illustration: LockerGnome

It started with a question on r/LaTeX about how to make flowers like the ones in someone’s document. Raymond’s README is careful about that: “I don’t know how the original was made, and this project doesn’t try to reproduce it. It is one possible way, and the way I did it.” The repo went up on October 30 and had passed 500 GitHub stars the same day.

The flowers are painted, not stamped. The README describes the order “a watercolorist would” use: “a flat wash, darker blotches multiplied over it, pigment pooling at the edges, streaks lifted out in white, a few fine veins, and almost no outlines.” All the geometry is computed in Lua and written as raw PDF path operators, so “TeX does no arithmetic.” The whole palette comes from one color you set, and the ramp from darkest stroke to palest wash is computed in OKLCH “so the light end stays blue instead of turning gray.”

There are two ways to fill a margin. The authored one grows a plant from the bottom-left corner through hand-picked control points. The grown one is where it gets clever: the stems sway up the column, and then a loop repeatedly takes “the largest free disc within reach of a stem, choose a motif that fits it, and grow a branch to it from the nearest stem point.” Big holes get flowers and lilies first; leaflets and buds get tucked in last. If the text ends early on the last page, branches arch down into the empty space, all in one compile.

That loop is credited to a real paper. The grown composition is “in the spirit of Wong, Zongker & Salesin,” whose paper Computer-Generated Floral Ornament ran at SIGGRAPH in 1998.

The margin also reads the text. A drop capital gets a vine that passes “over and under its strokes in turn,” and “The letter is also typeset invisibly, so the paragraph still copies as ‘Every’.” The sections option puts a flower beside every heading. The aging option moves the garden from spring on the first page to autumn on the last, with seed heads, falling petals and copper leaves. And most pages get visitors: butterflies, bees, a snail climbing a stem, and on about one page in five, a bird.

It isn’t random, either. “The seed is derived from the page number, so page n always gets garden n,” which the README calls what “makes the document stable enough to typeset.” There’s even a pure PostScript port that needs no TeX at all, where a printer “computes every petal while it interprets the page.” The README’s “How it works” section ends by pointing at a CLAUDE.md file in the repo for a map of the code and “ideas not yet done.”

LaTeX has a reputation as the thing you fight to get a table to sit still. This flips that. It treats the typesetter as a canvas that already knows exactly where every line ended, and uses that knowledge to draw around the words. The detail I keep coming back to is the drop capital that still copies as a real letter: someone cared about the person who highlights the paragraph to quote it, not only the person admiring the page. That’s what separates a nice demo from a package people will actually put in a document.

More Software

Every Software story →