Documentation

Variants

Alternate typefaces within formulas.

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

Functions

serifGo to source

Serif (roman) font style in math.

This is already the default.

math.serif(content) → content

body
content
RequiredPositional
Question mark

The content to style.

sansGo to source

Sans-serif font style in math.

ExpandView example
$ sans(A B C) $
math.sans(content) → content

body
content
RequiredPositional
Question mark

The content to style.

frakGo to source

Fraktur font style in math.

ExpandView example
$ frak(P) $
math.frak(content) → content

body
content
RequiredPositional
Question mark

The content to style.

monoGo to source

Monospace font style in math.

ExpandView example
$ mono(x + y = z) $
math.mono(content) → content

body
content
RequiredPositional
Question mark

The content to style.

bbGo to source

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.

ExpandView example
$ bb(b) $
$ bb(N) = NN $
$ f: NN -> RR $
math.bb(content) → content

body
content
RequiredPositional
Question mark

The content to style.

calGo to source

Calligraphic (chancery) font style in math.

ExpandView example
Let $cal(P)$ be the set of ...

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(content) → content

body
content
RequiredPositional
Question mark

The content to style.

scrGo to source

Script (roundhand) font style in math.

ExpandView example
$scr(L)$ is not the set of linear
maps $cal(L)$.

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.

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

We establish $cal(P) != scr(P)$.
math.scr(content) → content

body
content
RequiredPositional
Question mark

The content to style.