summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxwell Beck <max@rastertail.net>2026-07-22 21:14:12 -0500
committerMaxwell Beck <max@rastertail.net>2026-07-22 21:14:12 -0500
commitbc8049135a217439db96b36941b10002c064b03b (patch)
tree9bf15c84fac2f2abcbadfcea7521330a670d1a72
parent710f36df89d5639171b7b5dddc437090e1bc051b (diff)
Figure grid alignment
-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
}