Variants
Alternate typefaces within formulas.
These functions are distinct from the text function because math fonts
contain multiple variants of each letter.
Function
serif
serifSerif (roman) font style in math.
This is already the default.
bodyRequiredRequiredRequired parameters must be specified when calling the function.PositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe content to style.
sans
sansSans-serif font style in math.
$ sans(A B C) $

bodyRequiredRequiredRequired parameters must be specified when calling the function.PositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe content to style.
frak
frakFraktur font style in math.
$ frak(P) $

bodyRequiredRequiredRequired parameters must be specified when calling the function.PositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe content to style.
mono
monoMonospace font style in math.
$ mono(x + y = z) $

bodyRequiredRequiredRequired parameters must be specified when calling the function.PositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe content to style.
bb
bbBlackboard bold (double-struck) font style in math.
For uppercase latin letters, blackboard bold is additionally available
through symbols of the form NN and RR.
$ bb(b) $
$ bb(N) = NN $
$ f: NN -> RR $

bodyRequiredRequiredRequired parameters must be specified when calling the function.PositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe content to style.
cal
calCalligraphic font style in math.
Let $cal(P)$ be the set of ...

This corresponds both to LaTeX's \mathcal and \mathscr as both of these
styles share the same Unicode codepoints. Switching between the styles is
thus only possible if supported by the font via
font features.
For the default math font, the roundhand style is available through the
ss01 feature. Therefore, you could define your own version of \mathscr
like this:
#let scr(it) = text(
  features: ("ss01",),
  box($cal(it)$),
)
We establish $cal(P) != scr(P)$.

(The box is not conceptually necessary, but unfortunately currently needed due to limitations in Typst's text style handling in math.)
bodyRequiredRequiredRequired parameters must be specified when calling the function.PositionalPositionalPositional parameters can be set by specifying them in order, omitting the parameter name.
bodyThe content to style.