summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--raster.typ16
1 files changed, 16 insertions, 0 deletions
diff --git a/raster.typ b/raster.typ
index c62d9bc..22bbe48 100644
--- a/raster.typ
+++ b/raster.typ
@@ -12,6 +12,14 @@
top-edge: calc.ceil(scale(l).mm() / grid.mm()) * grid,
);
+ let gridround(body) = context {
+ let size = measure(body);
+ box(height: calc.ceil(size.height.mm() / grid.mm()) * grid)[
+ #set align(horizon)
+ #body
+ ]
+ };
+
set page(
paper: paper,
margin: (
@@ -61,5 +69,13 @@
]
);
+ show figure: it => block(
+ above: grid,
+ below: grid,
+ )[
+ #gridround(it.body)
+ #it.caption
+ ]
+
rest
}