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.

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.

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

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.

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

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.

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

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.

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

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 font style in math.

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

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)$.
Preview

(The box is not conceptually necessary, but unfortunately currently needed due to limitations in Typst's text style handling in math.)

math.cal()->

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