hn.today

Florilegium: Procedural Flowers in LaTeX

github.com289 points47 comments
Screenshot of Florilegium: Procedural Flowers in LaTeX

Florilegium is a LuaLaTeX package and collection of examples for generating Delft-blue floral decorations in page margins. Rather than embedding images or importing artwork, it computes petals, leaves, stems and other motifs from hand-designed drawing primitives, paints them with layered watercolor-like effects, and writes the results directly into the PDF. Randomized parameters give each page a distinct garden. The repository demonstrates two approaches: a hand-arranged composition whose elements vary with each seed, and a self-filling composition that grows into available margin space. Its growth algorithm repeatedly finds open areas and extends branches toward them, placing larger additions before filling smaller gaps.

The package can also make the decoration react to document content: vines can weave through decorative drop-cap initials, flowers can accompany section headings or appear where a command is placed, and the garden can shift from spring to autumn across a document. Butterflies, bees, snails and occasional birds add further detail, while a single chosen ink color determines the palette. Examples include PDFs, a gallery of seeds and colors, and an animation showing a garden growing. A separate, self-contained PostScript version reproduces the drawing and growth process without TeX, with some differences in randomness and transparency. Building the LaTeX examples requires LuaLaTeX; Docker instructions are provided for users without a TeX installation.

Read on github.com47 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.