Skip to main content

Flat Brace

flat-brace() 

Draw a flat curly brace between two points.

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

cetz.decorations.flat-brace((0,0),(2,0),
curves: .2,
aspect: 25%)
cetz.decorations.flat-brace((0,-1),(2,-1),
outer-curves: 0,
aspect: 75%)

This mimics the braces from TikZ's decorations.pathreplacing library. In contrast to the brace function, these braces use straight line segments, resulting in better looks for long braces with a small amplitude.

Start point

End point

flip:

Default: false

Flip the brace around

name:

str or none
Default: none

Element name for querying anchors

..style:

Style key-value pairs

Styling

Root: flat-brace

amplitude:

Default: 0.3

Determines how much the brace rises above the base line.

  • aspect (ratio) = 50% Determines the fraction of the total length where the spike will be placed.

    curves:

    Default: auto

    Curviness factor of the brace, a factor of 0 means no curves.

    outer-curves:

    Default: auto

    Curviness factor of the outer curves of the brace. A factor of 0 means no curves.

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's top.
  • content Point to place content/text at, in front of the spike.
  • center Center of the enclosing rectangle.