typst/tests/typ/expand.typ
Laurenz c1b1dbcc09 Better expansion behaviour 🐪
This makes expansion behaviour inheritable by placing it into the area and passing it down during layouting instead of computing some approximation of what we want during execution.
2021-03-11 10:48:29 +01:00

15 lines
353 B
Typst

// Test fit/fill expansion.
---
#let right(body) = align(right, body)
#let pad(body) = pad(left: 10pt, right: 10pt, body)
// Top-level paragraph fills page, boxed paragraph only when width is fixed.
L #right[R] \
#box(width: 50pt)[L #right[R]] \
#box[L #right[R]] \
// Pad inherits expansion behaviour.
#pad[PL #right[PR]] \
#box(pad[PL #right[PR]])