mirror of
https://github.com/typst/typst
synced 2025-05-16 01:55:28 +08:00
15 lines
359 B
Typst
15 lines
359 B
Typst
// Test shrink-to-fit vs expand.
|
|
|
|
---
|
|
#let right(body) = align(right, body)
|
|
#let pad(body) = pad(left: 10pt, right: 10pt, body)
|
|
|
|
// Top-level paragraph fills page, boxed paragraph only when the width is set.
|
|
L #right[R] \
|
|
#rect(width: 50pt)[L #right[R]] \
|
|
#rect[L #right[R]]
|
|
|
|
// Pad inherits expansion behaviour.
|
|
#rect(pad[PL #right[PR]])
|
|
#pad[PL #right[PR]]
|