Package Information
- Last Updated
- Minimum Typst Version
- 0.15.0
- Authors
- Ludwig Austermann
1. Get the package
Download the package using the TPIX CLI:
tpix get @preview/modpattern:0.2.02. Import in your Typst file
Add this to your .typ file:
#import "@preview/modpattern:0.2.0": *modpattern
This package provides exactly one function: modpattern
It is defined similarly to the official tiling function, but it fixes some caveats, as can be seen here:

modpattern function
The function with the signature
modpattern(..args, background: none)
has the following parameters:
argswith- positional
bodyas the inside/body/content of the tiling - necessary named
sizeas a pair of two lengths - and the other named arguments the offical tiling type provides, currently:
offset: a pair of lengths translating the contentspacing: a pair of lengths changing distance between tiling repetition
- positional
backgroundallows any type allowed in the box fill argument. It gets applied first
Notice that, in contrast to typst tilings, size is a necessary argument.
Take a look at the example directory, to understand how to use this and to see the reasoning behind the background argument.