Line
line
A line from one point to another.
Example
#set page(height: 100pt)
#line(length: 100%)
#line(end: (50%, 50%))
#line(
length: 4cm,
stroke: 2pt + maroon,
)#line(
start: array,
end: none | array,
length: relative,
angle: angle,
stroke: length | color | gradient | stroke | tiling | dictionary
) -> contentParameters
- start:
- description: The start point of the line. Must be an array of exactly two relative lengths.
- type: array
- default: (0 % + 0pt, 0 % + 0pt)
- end:
- description: The point where the line ends.
- type: none | array
- default: none
- length:
- description: The line's length. This is only respected if
endisnone. - type: relative
- default: 0 % + 30pt
- description: The line's length. This is only respected if
- angle:
- description: The angle at which the line points away from the origin. This is only respected if
endisnone. - type: angle
- default: 0deg
- description: The angle at which the line points away from the origin. This is only respected if
- stroke:
- description: How to stroke the line.
typst #set line(length: 100%) #stack( spacing: 1em, line(stroke: 2pt + red), line(stroke: (paint: blue, thickness: 4pt, cap: "round")), line(stroke: (paint: blue, thickness: 1pt, dash: "dashed")), line(stroke: (paint: blue, thickness: 1pt, dash: ("dot", 2pt, 4pt, 2pt))), ) - type: length | color | gradient | stroke | tiling | dictionary
- default: 1pt + black
- description: How to stroke the line.