mirror of
https://github.com/typst/typst
synced 2025-05-19 11:35:27 +08:00
- Templates scope state changes - State-modifying function operate in place instead of returning a template - Internal template representation contains actual owned nodes instead of a pointer to a syntax tree + an expression map - No more wide calls
29 lines
589 B
XML
29 lines
589 B
XML
// Test the `square` function.
|
|
|
|
---
|
|
Auto-sized square. \
|
|
#square(fill: eastern)[
|
|
#font(fill: white, weight: bold)
|
|
#align(center)
|
|
#pad(5pt)[Typst]
|
|
]
|
|
|
|
---
|
|
// Test height overflow.
|
|
#page(width: 75pt, height: 100pt)
|
|
#square(fill: conifer)[
|
|
But, soft! what light through yonder window breaks?
|
|
]
|
|
|
|
---
|
|
// Test width overflow.
|
|
#page(width: 100pt, height: 75pt)
|
|
#square(fill: conifer)[
|
|
But, soft! what light through yonder window breaks?
|
|
]
|
|
|
|
---
|
|
// Length wins over width and height.
|
|
// Error: 09-20 unexpected argument
|
|
#square(width: 10cm, height: 20cm, length: 1cm, fill: rgb("eb5278"))
|