// Example 6: Flowchart Diagram with CeTZ #import "@preview/cetz:0.4.2" #set text(font: "Libertinus Serif", size: 11pt) #set page(width: auto, height: auto, margin: 0.5cm) #cetz.canvas({ import cetz.draw: * let start-fill = blue.lighten(70%) let process-fill = green.lighten(70%) let decision-fill = orange.lighten(70%) let end-fill = red.lighten(70%) // Start node rect((0, 4), (3, 5.5), fill: start-fill, stroke: blue) content((1.5, 4.75), [Start], anchor: "center") // First process rect((5, 4), (9, 5.5), fill: process-fill, stroke: green) content((7, 4.75), [Load Data], anchor: "center") // Decision rect((5, 1.5), (9, 3.5), fill: decision-fill, stroke: orange, radius: 0.3) content((7, 2.5), [Valid?], anchor: "center") // Process 2 rect((11, 4), (15, 5.5), fill: process-fill, stroke: green) content((13, 4.75), [Process], anchor: "center") // Error handler rect((11, 0), (15, 1.5), fill: end-fill, stroke: red) content((13, 0.75), [Error Log], anchor: "center") // End node rect((16, 4), (19, 5.5), fill: start-fill, stroke: blue) content((17.5, 4.75), [End], anchor: "center") // Arrows line((3, 4.75), (5, 4.75), mark: (end: ">"), stroke: black + 1pt) line((9, 4.75), (9, 2.5), mark: (end: ">"), stroke: black + 1pt) line((9, 2.5), (11, 4.75), mark: (end: ">"), stroke: black + 1pt) line((7, 1.5), (7, 0.75), mark: (end: ">"), stroke: black + 1pt) line((7, 0.75), (11, 0.75), mark: (end: ">"), stroke: black + 1pt) line((11, 0.75), (11, 4.75), mark: (end: ">"), stroke: black + 1pt) line((15, 4.75), (16, 4.75), mark: (end: ">"), stroke: black + 1pt) // Labels content((4, 5), [Initialize], anchor: "south") content((9.5, 2.5), [Yes], anchor: "west") content((7, 1.8), [No], anchor: "south") })