Info
This site is generated using the static site generator developed by the Typst Community. Please adjust the text content of this banner according to your usage requirements. At Typst GmbH's request, when publishing documentation, you must clearly indicate that it is non-official and display the version of Typst being documented. For details, refer to Issue #874 on typst/typst.
TypstDocumentEnglish
v0.dev.2025-09-12

Variants

Alternate typefaces within formulas.

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

Function

serif

Serif (roman) font style in math.

This is already the default.

math.serif()->

body
Required
Required
Required parameters must be specified when calling the function.
Positional
Positional
Positional parameters can be set by specifying them in order, omitting the parameter name.

The content to style.

sans

Sans-serif font style in math.

math.sans()->
$ sans(A B C) $
Preview

body
Required
Required
Required parameters must be specified when calling the function.
Positional
Positional
Positional parameters can be set by specifying them in order, omitting the parameter name.

The content to style.

frak

Fraktur font style in math.

math.frak()->
$ frak(P) $
Preview

body
Required
Required
Required parameters must be specified when calling the function.
Positional
Positional
Positional parameters can be set by specifying them in order, omitting the parameter name.

The content to style.

mono

Monospace font style in math.

math.mono()->
$ mono(x + y = z) $
Preview

body
Required
Required
Required parameters must be specified when calling the function.
Positional
Positional
Positional parameters can be set by specifying them in order, omitting the parameter name.

The content to style.

bb

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.

math.bb()->
$ bb(b) $
$ bb(N) = NN $
$ f: NN -> RR $
Preview

body
Required
Required
Required parameters must be specified when calling the function.
Positional
Positional
Positional parameters can be set by specifying them in order, omitting the parameter name.

The content to style.

cal

Calligraphic (chancery) font style in math.

math.cal()->
Let $cal(P)$ be the set of ...
Preview

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

body
Required
Required
Required parameters must be specified when calling the function.
Positional
Positional
Positional parameters can be set by specifying them in order, omitting the parameter name.

The content to style.

scr

Script (roundhand) font style in math.

math.scr()->
$ scr(S) $
Preview

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 this:

#let scr(it) = text(
  stylistic-set: 1,
  $cal(it)$,
)

We establish $cal(P) != scr(P)$.
Preview

body
Required
Required
Required parameters must be specified when calling the function.
Positional
Positional
Positional parameters can be set by specifying them in order, omitting the parameter name.

The content to style.

Open official docs

Search