For most of us, LaTeX is the realm of rigid grids, austere academic papers, and the occasional struggle with a BibTeX entry. It is the antithesis of organic art. But a new project called Florilegium is turning the world's most famous typesetting engine into a digital canvas, proving that mathematics and botany are a match made in heaven.
From Reddit Threads to Digital Blooms
It all started with a simple question on Reddit: How do I make flowers like these in LaTeX? While many would have suggested simply importing a PNG or SVG, developer Kevin Raymond took a more ambitious route. Instead of static images, he built a LuaLaTeX package that generates "Delft-blue" style floral margins in real-time.
Rather than using pre-drawn assets, Florilegium uses hand-authored primitives—basic shapes that act as the DNA of a flower—and applies randomized parameters to them. The result is a watercolor-like aesthetic where every petal, leaf, and stem is calculated on the fly during the PDF rendering process.
The Math Behind the Magic
What makes Florilegium truly impressive isn't just the art, but the engineering. To handle the layout of these gardens, the project integrates a space-filling algorithm from a 1998 SIGGRAPH paper. This allows the flowers to "grow" intelligently within the page margins without overlapping awkwardly or leaving gaping holes.
By leveraging LuaLaTeX, the package can compile a beautifully decorated page in about a second. It offers two modes: a manually refined composition for those who want total control, and an automated growth mode for those who want the algorithm to decide where the blooms land.
A New Era of Academic Aesthetics
While we might not see floral margins in every PhD thesis tomorrow, Florilegium represents a fascinating intersection of procedural generation and traditional typesetting. It pushes the boundaries of what we consider a "document," transforming the PDF from a static container of text into a dynamic piece of generative art.
Sources
Media



