Typst Fumadocs

Left/Right

Documentation for the lr functions.

Delimiter matching.

The lr function allows you to match two delimiters and scale them with the content they contain. While this also happens automatically for delimiters that match syntactically, lr allows you to match two arbitrary delimiters and control their size exactly. Apart from the lr function, Typst provides a few more functions that create delimiter pairings for absolute, ceiled, and floored values as well as norms.

To prevent a delimiter from being matched by Typst, and thus auto-scaled, escape it with a backslash. To instead disable auto-scaling completely, use set math.lr(size: 1em).

Example

Loading compiler...

Scales delimiters.

While matched delimiters scale by default, this can be used to scale unmatched delimiters and to control the delimiter scaling more precisely.

#math.lr(
  size: relative,
  body
) -> content

Parameters

Prop

Type

Scales delimiters vertically to the nearest surrounding lr() group.

Loading compiler...
#math.mid(
  body
) -> content

Parameters

Prop

Type

Takes the absolute value of an expression.

Loading compiler...
#math.abs(
  size: relative,
  body
) -> content

Parameters

Prop

Type

Takes the norm of an expression.

Loading compiler...
#math.norm(
  size: relative,
  body
) -> content

Parameters

Prop

Type

Floors an expression.

Loading compiler...
#math.floor(
  size: relative,
  body
) -> content

Parameters

Prop

Type

Ceils an expression.

Loading compiler...
#math.ceil(
  size: relative,
  body
) -> content

Parameters

Prop

Type

Rounds an expression.

Loading compiler...
#math.round(
  size: relative,
  body
) -> content

Parameters

Prop

Type

On this page