mirror of
https://github.com/wassname/draw_diag.git
synced 2026-07-26 13:18:03 +08:00
20 lines
493 B
Typst
20 lines
493 B
Typst
#import "@preview/cetz:0.4.2"
|
|
|
|
#set page(width: auto, height: auto, margin: 1cm)
|
|
|
|
#align(center)[*Simple CeTZ Test*]
|
|
|
|
#cetz.canvas({
|
|
import cetz.draw: *
|
|
|
|
// Simple boxes and arrows
|
|
rect((0, 0), (2, 1), fill: blue.lighten(80%), stroke: black, name: "box1")
|
|
content((1, 0.5), [Box 1])
|
|
|
|
rect((0, -2), (2, -1), fill: red.lighten(80%), stroke: black, name: "box2")
|
|
content((1, -1.5), [Box 2])
|
|
|
|
// Arrow between them
|
|
line((1, 0), (1, -1), mark: (end: ">"), stroke: black + 1.5pt)
|
|
})
|