Typst Fumadocs

Variants

Documentation for the variants functions.

Alternate typefaces within formulas.

These functions are distinct from the text function because math fonts contain multiple variants of each letter.

Serif (roman) font style in math.

This is already the default.

#math.serif(
  body
) -> content

Parameters

Prop

Type

Sans-serif font style in math.

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

Parameters

Prop

Type

Fraktur font style in math.

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

Parameters

Prop

Type

Monospace font style in math.

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

Parameters

Prop

Type

Blackboard bold (double-struck) font style in math.

For uppercase latin letters, blackboard bold is additionally available through symbols of the form NN and RR.

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

Parameters

Prop

Type

Calligraphic (chancery) font style in math.

Loading compiler...

This is the default calligraphic/script style for most math fonts. See scr for more on how to get the other style (roundhand).

#math.cal(
  body
) -> content

Parameters

Prop

Type

Script (roundhand) font style in math.

Loading compiler...

There are two ways that fonts can support differentiating cal and scr. The first is using Unicode variation sequences. This works out of the box in Typst, however only a few math fonts currently support this.

The other way is using font features. For example, the roundhand style might be available in a font through the stylistic set 1 (ss01) feature. To use it in Typst, you could then define your own version of scr like in the example below.

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

Parameters

Prop

Type

On this page