TypstDocumentation

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.

lr function

Scales delimiters.

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

Example

$ lr(]a, b/2]) $
$ lr(]sum_(x=1)^n] x, size: #50%) $
Preview

Parameters
Question mark

body
contentPositional
Question mark
Variadic
Question mark

The delimited content, including the delimiters.

size

The size of the brackets, relative to the height of the wrapped content.

Defaults to 100%.

abs function

Take the absolute value of an expression.

Example

$ abs(x/2) $
Preview

Parameters
Question mark

abs()

body
contentRequiredPositional
Question mark

The expression to take the absolute value of.

norm function

Take the norm of an expression.

Example

$ norm(x/2) $
Preview

Parameters
Question mark

norm()

body
contentRequiredPositional
Question mark

The expression to take the norm of.

floor function

Floor an expression.

Example

$ floor(x/2) $
Preview

Parameters
Question mark

floor()

body
contentRequiredPositional
Question mark

The expression to floor.

ceil function

Ceil an expression.

Example

$ ceil(x/2) $
Preview

Parameters
Question mark

ceil()

body
contentRequiredPositional
Question mark

The expression to ceil.