mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
37 lines
572 B
Typst
37 lines
572 B
Typst
// Test the `box` and `block` containers.
|
|
|
|
---
|
|
// Test box in paragraph.
|
|
A #box[B \ C] D.
|
|
|
|
// Test box with height.
|
|
Spaced \
|
|
#box(height: 0.5cm) \
|
|
Apart
|
|
|
|
---
|
|
// Test box sizing.
|
|
#box(width: 50pt, height: 50pt, fill: yellow, path(
|
|
fill: purple,
|
|
(0pt, 0pt),
|
|
(30pt, 30pt),
|
|
(0pt, 30pt),
|
|
(30pt, 0pt),
|
|
))
|
|
|
|
---
|
|
// Test fr box.
|
|
Hello #box(width: 1fr, rect(height: 0.7em, width: 100%)) World
|
|
|
|
---
|
|
// Test block over multiple pages.
|
|
|
|
#set page(height: 60pt)
|
|
|
|
First!
|
|
|
|
#block[
|
|
But, soft! what light through yonder window breaks? It is the east, and Juliet
|
|
is the sun.
|
|
]
|