Skip to main content

Flat Brace

flat-brace() 

Draw a flat curly brace between two points.

This mimics the braces from TikZ’s [decorations.pathreplacing library](https://github.com/pgf-tikz/pgf/blob/6e5fd71581ab04351a89553a259b57988bc28140/tex/generic/pgf/libraries/decorations/pgflibrarydecorations.pathreplacing.code.tex#L136-L185). In contrast to the brace function, these braces use straight line segments, resulting in better looks for long braces with a small amplitude.

Styling

Root: flat-brace

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

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.
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%)

Start point

End point

flip:

Flip the brace around

name:

str or none

Element name for querying anchors

debug:

..style:

Style key-value pairs

amplitude:

Default: 0.3

Determines how much the brace rises above the base line.

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.