canvas
canvas(length: lengthratio,debug: bool,background: nonecolor,padding: nonenumberarraydictionary,body: nonearrayelement,) -> content
Sets up a canvas for drawing on.
Used to specify what 1 coordinate unit is. If given a ratio, that ratio is relative to the containing elements width!
A code block in which functions from the draw
module have been called.
padding:
none
How much padding to add to the canvas. none
applies no padding. A number applies padding to all sides equally. A dictionary applies padding following Typst's pad
function: https://typst.app/docs/reference/layout/pad/. An array follows CSS like padding: (y, x)
, (top, x, bottom)
or (top, right, bottom, left)
.