Alex’s notes

Software, useful tools, and making things.

A Garden That Fills Whatever Space Your Text Leaves

Florilegium, a LuaLaTeX package published on 30 October, paints a blue garden down the margin of every page and lets the branches grow into whatever space the text leaves. Page seven always gets the same garden, and page eight gets a different one.

I would use it for one page that is going to be printed or sent, and keep the PDF afterwards. I wouldn’t build a document I expect to keep editing around it, at least not yet. I haven’t built it myself. This comes from the README, the source files, the open issues and the Hacker News thread, all read on the day the project appeared.

How the margin grows

The README says every petal, leaf and stem is a curve computed in Lua while the page is written, with no images or imported paths. There are two compositions. The authored one places stems and leaves by hand. The grown one takes the largest empty circle near a stem, picks a motif that fits it and grows a branch there, then repeats, so a short last page fills the space under its final line.

The author credits the second approach to a 1998 SIGGRAPH paper on generating floral ornament by computer, by Wong, Zongker and Salesin. Its abstract describes “adaptive clip art”: the rules for an ornament, which can be generated again to fill a region when the region changes shape. The idea is old. What’s new is that a LaTeX package now does it for your pages.

The garden is repeatable because the seed comes from the page number, so page n always gets garden n. That sounds automatic, and it wasn’t. One of the first commits changed the authored page to draw its stems in a fixed order, because Lua visited them in a different order from run to run and the PDF came out slightly different on every build.

A third of the page

Both demo documents set a left margin of 68 mm on A4 paper. A4 is 210 mm wide, so the garden’s column takes a little under a third of the page. The README says the grown composition adapts to the page layout, and the package has options to drop the margin or the butterflies, bees, snail and bird. The documentation doesn’t tell me how it looks in a narrow margin.

An open issue asks for smaller flowers, from someone who found that the project “kind of occupies the page”. That describes the demos fairly, and it is a reasonable question about the package.

For a dedication page, a poem, a menu or a card, the space is the point. A printed border takes room, and you chose a border. For a report that will be revised ten times, I would want the text to have the room first.

Keep the PDF, not the seed

The PostScript port looks like the portable option. It is one file that Ghostscript runs, with no TeX installed. But it sets its own two pages of text in Times, with no initials, animation or authored page, so it gives you a garden page and not a margin for your own words. And seed 7 in PostScript is a different garden from seed 7 in LaTeX, because the two use different arithmetic for the random numbers. The project’s own notes add that the port isn’t kept in sync automatically when the Lua changes.

So a garden you like lives in the PDF. A seed reproduces it only in the same version of the same implementation, and this repository was hours old when I read it. It had already reached version 1.1 and added the PostScript port the same day. If you find a page you like, I would save the PDF and the package files next to each other, and expect the PDF to be the part that still opens in ten years.

The README gives two ways to try it without installing TeX: a Docker image, or pasting the style file, six Lua files and one demo document into an Overleaf project set to LuaLaTeX.

What the generator leaves to you

The commands I would keep for myself are the small ones. \florilegiumbloom puts a flower beside the line it sits in, and \florilegiuminitial sets a paragraph’s first letter in a decorated tile several lines tall. The ink colour comes from one chosen hue. The machine can paint a lily. Which line deserves it is a different sort of decision.

There are two fair objections. One Hacker News commenter said that TeX ornament used to be a craft, and that this is “pretty neat” but not the same as carrying that tradition on. Others disliked that the README text read as AI written. The repository does include a CLAUDE.md file, the name Anthropic’s Claude Code looks for, so some AI help is plausible. I can’t see how much, and it wouldn’t change what the garden costs to keep.

The craft objection holds if your pleasure is in drawing the vine. Then draw it, and skip this. If you want one handsome page and some say over where the flowers go, choosing a seed and a few lines is a reasonable share of the work. A report would stay in plain margins.

Comments