Watercolour flora and gilt ornaments grown in the margins of Typst documents. Every page grows its own plant around the text it holds, computed when the document compiles and painted as vector paths. No tool is needed beyond Typst.
Full documentation · Typst Universe · Releases
#import "@preview/hortulus:0.1.0": flora
#set page(margin: (left: 2.5cm, right: 5.5cm, y: 2.5cm))
#show: flora.with(layout: "right", colourway: "spring", seed: 7)
= My document
#lorem(200)Give the flora room: about 5 cm for a side margin, or 3 cm all round for surround.
Every option is described in the documentation. Pass
draft: true to leave the flora out while you write.
0.1.1 (in this repository, not yet on Typst Universe)
- PDFs about 45% smaller, and each page embeds faster: coordinates are written to a tenth of a point, and the smallest dots as squares or octagons of the same area, all within 0.03 mm of the previous drawing.
- A page whose spec has not changed is no longer grown again after an edit elsewhere in the document.
0.1.0: first release.
Up close: the blooms are vector paths painted like watercolour, and the gold is computed per pixel.
The eight colourways: spring, summer, autumn and winter above; ember, plum, rose and original below.
The same page with other options. Above: density: 0.4, density: 2, visitors: 4 and mix: (lily: 3, bloom: 0, umbel: 0). Below: palette with one ink, palette with two inks, ornaments: (moon: 5, night: 0, sun: 0, planet: 0) and draft: true.
The plant grows around what the page holds: a gap in the text, a table and an equation, a floating figure, and two columns with layout: "split".
package/: the Typst package, as published.plugin/: the Rust source of the package's WebAssembly plugin.reference/: the Lua generator of tikz-flora (MIT), which the plugin ports and is checked against.tools/: the build scripts and the tests.
You need a Rust toolchain with the wasm32-unknown-unknown target, and wasm-opt from Binaryen.
RUSTUP_HOME=... CARGO_HOME=... tools/build_wasm.sh # see the script for the paths it sets
cp build/hortulus.wasm package/hortulus.wasmWith typst and ImageMagick on your path, tools/build_gallery.sh paints the gallery from
tools/gallery/ into package/images/.
With texlua on your path and the native build in place (cargo build --release in plugin/),
tools/run_matrix.sh paints each case with both generators and compares the output byte for byte.
The package itself writes a more compact encoding of the same drawing; pass compact as a
fourth argument to native to get it.
MIT. See LICENSE. reference/ keeps its own license.




