Skip to main content

Brace

brace() 

Draw a curly brace between two points.

cetz.decorations.brace((0,1),(2,1))

cetz.decorations.brace((0,0),(2,0),
pointiness: 45deg, outer-pointiness: 45deg)
cetz.decorations.brace((0,-1),(2,-1),
pointiness: 90deg, outer-pointiness: 90deg)

Start point

End point

name:

Default: none

Element name used for querying anchors

..style:

Style key-value pairs

Styling

Root: brace

amplitude:

Default: 0.5

Sets the height of the brace, from its baseline to its middle tip.

pointiness:

Default: 15deg

How pointy the spike should be. 0deg or 100% for maximum pointiness, 90deg or 0% for minimum.

outer-pointiness:

Default: 15deg

How pointy the outer edges should be. 0deg or 100% for maximum pointiness (allowing for a smooth transition to a straight line), 90deg or 0% for minimum. Setting this to auto will use the value set for pointiness.

content-offset:

Default: 0.3

Offset of the "content" anchor from the spike of the brace.

flip:

Default: false

Mirror the brace along the line between start and end.

Anchors

  • start Where the brace starts, same as the start parameter.
  • end Where the brace end, same as the end parameter.
  • spike Point of the spike, halfway between start and end and shifted by amplitude towards the pointing direction.
  • content Point to place content/text at, in front of the spike.
  • center Center of the enclosing rectangle.