<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/florilegium-procedural-flowers-in-latex-q6bncxote" -->

---
title: Florilegium: Procedural Flowers in LaTeX | daily.dev
description: Florilegium is a LuaLaTeX package that draws procedurally generated Delft-blue floral page margins directly into the PDF, with every petal, leaf and stem...
canonical: https://daily.dev/posts/florilegium-procedural-flowers-in-latex-q6bncxote
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Florilegium: Procedural Flowers in LaTeX | daily.dev
og:description: Florilegium is a LuaLaTeX package that draws procedurally generated Delft-blue floral page margins directly into the PDF, with every petal, leaf and stem...
og:url: https://daily.dev/posts/florilegium-procedural-flowers-in-latex-q6bncxote
og:image: https://api.daily.dev/og/posts/q6BnCXoTe.png
og:image:alt: Florilegium: Procedural Flowers in LaTeX
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Florilegium: Procedural Flowers in LaTeX

**[Hacker News](https://daily.dev/sources/hn)** · 11 min read · 0 upvotes · 0 comments

## Summary

Florilegium is a LuaLaTeX package that draws procedurally generated Delft-blue floral page margins directly into the PDF, with every petal, leaf and stem computed as a parametric curve in Lua. It offers an 'authored' mode with hand-placed stems and flowers, and a 'grown' mode that fills free page space using a greedy space-filling loop inspired by a 1998 SIGGRAPH paper. Features include decorated initials, flowers at section headings, seasonal aging across pages, and visiting butterflies, bees, snails and birds. A ported version runs in pure PostScript via Ghostscript, rendering two pages in about 2.5 seconds. The seed is derived from the page number, so the same page always regenerates the same garden.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://github.com/kevinraymond/florilegium>

## Questions this post answers

### How can I draw custom vector graphics directly into a PDF using LuaLaTeX?

Geometry can be computed entirely in Lua and written as PDF path operators into a literal node per page, so TeX itself does no arithmetic. Primitives are drawn in a local frame under an affine transform that can be read from a TikZ scope's shift, rotation and scale when called inside one, enabling reusable procedural drawing routines.

_daily.dev surfaces LuaLaTeX and procedural graphics techniques for developers building generative PDF output._

### How do you port a Lua graphics generator to run as a standalone PostScript file?

Map translation, rotation and scale to PostScript's native transformation matrix, use its native paths and Bezier curves, and build procedures at run time to stand in for Lua closures. Layers need manual handling since PostScript paints in one order, via pathforall capturing shapes into per-layer lists replayed at the end; transparency requires Ghostscript's -dALLOWPSTRANSPARENCY flag since PostScript has none natively.

_developers porting generative Lua code to PostScript can track these translation patterns on daily.dev._

### What algorithm fills empty space in a generative layout with flowers and foliage realistically?

A greedy space-filling loop repeatedly finds the largest free disc within reach of a stem, chooses a motif that fits it, and grows a branch to that disc from the nearest stem point, with the new branch becoming a stem in turn. Big holes get filled first so flowers and lilies land early, while sprays, leaves, buds and florets fill in later, an approach in the spirit of the 1998 SIGGRAPH paper 'Computer-Generated Floral Ornament'.

_daily.dev helps developers exploring generative layout algorithms find techniques like this space-filling approach._

## Community take

How the wider developer community reacted, aggregated from 1 discussion and 42 comments across hackernews (as of 2026-10-31).

**TL;DR:** Most developers are delighted by the visuals and the cleverness of procedural flower generation in LaTeX, but a vocal subset is annoyed that the README and possibly the whole project appear AI-written, and there's some unease about the idea being copied from a closed-source Reddit original.

**Sentiment:** 60% positive · 25% mixed · 15% skeptical

**The case for**

- Many find the generated flowers genuinely beautiful and impressive as a technical feat.
- Several appreciate that each print run/page produces different procedurally generated flowers.
- Some enjoyed learning tangential facts, like the etymology of 'florilegium' and other procedural TeX/MetaPost art projects it reminded them of.

**The pushback**

- Some find the AI-generated README and prose style grating and feel it undermines trust in the project.
- A few feel uneasy that the underlying idea/style was taken from a Reddit post by someone who wanted to keep their original implementation closed source.
- Some question why effort/care should matter if the end result works, leading to a side debate about AI-assisted publishing norms.

**By community**

- hackernews (mixed): Admiration for the visuals and cleverness is widespread, but it's tangled with a recurring debate over the project's AI-written README and its relationship to a closed-source original.

**Hottest debate:** Whether it's acceptable to publish and reimplement someone else's idea using AI-generated code and writing without crediting or matching the original creator's effort.

**Open questions**

- Will the author add more style options or try to more closely match the original Reddit implementation's aesthetic?
- Could a similar procedural decoration system be built for Typst instead of LaTeX?

**Highlights**

> Readme is AI. :/
> — [bonzini on hackernews · 2 comments](https://news.ycombinator.com/item?id=50307726)

> Not just the README, all of it. The author gives more details about it here: https://www.reddit.com/r/LaTeX/comments/1xixznw/comment/19rv...
> — [Thomashuet on hackernews · 1 comments](https://news.ycombinator.com/item?id=50308999)

> Why should anyone care if you care?
> — [0x20cowboy on hackernews · 1 comments](https://news.ycombinator.com/item?id=50310889)

> > The creator prefers to keep the source closed to avoid code critiques That doesn't sound like someone who doesn't want their idea copied.
> — [bluerooibos on hackernews](https://news.ycombinator.com/item?id=50310532)

> Am I miffed that something I've tried multiple times with the latest models has been accomplished here so beautifully, and in LUA (!!!) nonetheless? A little! But it's worth it to know that it is indeed possible... Great work. I doubt you care, but try not to get caught up in the idea that you might have violated someones god-given property rights by making pretty flowers for fun in the margins of PDFs.
> — [bbor on hackernews](https://news.ycombinator.com/item?id=50310049)

**Source threads**

- [hackernews](https://news.ycombinator.com/item?id=50305637) · 228 points · 42 comments

## Similar posts on daily.dev

- [Lindenmayer Systems](https://daily.dev/posts/lindenmayer-systems-57l956gqx) · Lobsters · 0 upvotes · 0 comments
- [Breaking Down Creation Of Flower In This Blender Animation](https://daily.dev/posts/breaking-down-creation-of-flower-in-this-blender-animation-uk5uxnfkc) · 80 LEVEL · 0 upvotes · 0 comments
- [Little useless-useful R functions – Desk plant simulator](https://daily.dev/posts/little-useless-useful-r-functions-desk-plant-simulator-cpylh9t2v) · R-bloggers · 0 upvotes · 0 comments
- [lukilabs/beautiful-mermaid](https://daily.dev/posts/lukilabs-beautiful-mermaid-mnq05qf1z) · Hacker News · 6 upvotes · 0 comments

---

Tags: [#game-development](https://daily.dev/tags/game-development), [#lua](https://daily.dev/tags/lua)

[View this post on daily.dev](https://daily.dev/posts/florilegium-procedural-flowers-in-latex-q6bncxote)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Florilegium: Procedural Flowers in LaTeX","url":"https://daily.dev/posts/florilegium-procedural-flowers-in-latex-q6bncxote","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/florilegium-procedural-flowers-in-latex-q6bncxote"},"datePublished":"2026-10-30T18:04:43.494Z","dateModified":"2026-10-31T03:50:44.683Z","description":"Florilegium is a LuaLaTeX package that draws procedurally generated Delft-blue floral page margins directly into the PDF, with every petal, leaf and stem...","image":"https://media.daily.dev/image/upload/s--0_ODbtD2--/f_auto/v1722860399/public/Placeholder%2008","thumbnailUrl":"https://media.daily.dev/image/upload/s--0_ODbtD2--/f_auto/v1722860399/public/Placeholder%2008","isAccessibleForFree":true,"articleSection":"Hacker News","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Hacker News","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/hn","url":"https://daily.dev/sources/hn"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/florilegium-procedural-flowers-in-latex-q6bncxote","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"game-development,lua","timeRequired":"PT11M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Hacker News","item":"https://daily.dev/sources/hn"},{"@type":"ListItem","position":3,"name":"Florilegium: Procedural Flowers in LaTeX"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/florilegium-procedural-flowers-in-latex-q6bncxote#faq","mainEntity":[{"@type":"Question","name":"How can I draw custom vector graphics directly into a PDF using LuaLaTeX?","acceptedAnswer":{"@type":"Answer","text":"Geometry can be computed entirely in Lua and written as PDF path operators into a literal node per page, so TeX itself does no arithmetic. Primitives are drawn in a local frame under an affine transform that can be read from a TikZ scope's shift, rotation and scale when called inside one, enabling reusable procedural drawing routines. daily.dev surfaces LuaLaTeX and procedural graphics techniques for developers building generative PDF output."}},{"@type":"Question","name":"How do you port a Lua graphics generator to run as a standalone PostScript file?","acceptedAnswer":{"@type":"Answer","text":"Map translation, rotation and scale to PostScript's native transformation matrix, use its native paths and Bezier curves, and build procedures at run time to stand in for Lua closures. Layers need manual handling since PostScript paints in one order, via pathforall capturing shapes into per-layer lists replayed at the end; transparency requires Ghostscript's -dALLOWPSTRANSPARENCY flag since PostScript has none natively. developers porting generative Lua code to PostScript can track these translation patterns on daily.dev."}},{"@type":"Question","name":"What algorithm fills empty space in a generative layout with flowers and foliage realistically?","acceptedAnswer":{"@type":"Answer","text":"A greedy space-filling loop repeatedly finds the largest free disc within reach of a stem, chooses a motif that fits it, and grows a branch to that disc from the nearest stem point, with the new branch becoming a stem in turn. Big holes get filled first so flowers and lilies land early, while sprays, leaves, buds and florets fill in later, an approach in the spirit of the 1998 SIGGRAPH paper 'Computer-Generated Floral Ornament'. daily.dev helps developers exploring generative layout algorithms find techniques like this space-filling approach."}}]}
```

