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-10-13

equation
Element
Element
Element functions can be customized with set and show rules.

A mathematical equation.

Can be displayed inline with text or as a separate block. An equation becomes block-level through the presence of whitespace after the opening dollar sign and whitespace before the closing dollar sign.

Example

#set text(font: "New Computer Modern")

Let $a$, $b$, and $c$ be the side
lengths of right-angled triangle.
Then, we know that:
$ a^2 + b^2 = c^2 $

Prove by induction:
$ sum_(k=1)^n k = (n(n+1)) / 2 $
Preview

By default, block-level equations will not break across pages. This can be changed through show math.equation: set block(breakable: true).

Syntax

This function also has dedicated syntax: Write mathematical markup within dollar signs to create an equation. Starting and ending the equation with whitespace lifts it into a separate block that is centered horizontally. For more details about math syntax, see the main math page.

Parameter
Parameter
Parameters are input values for functions. Specify them in parentheses after the function name.

block
Settable
Settable
Settable parameters can be set using the set rule, changing the default value used thereafter.

Whether the equation is displayed as a separate block.

Default value:

false

numbering
Settable
Settable
Settable parameters can be set using the set rule, changing the default value used thereafter.

How to number block-level equations. Accepts a numbering pattern or function taking a single number.

Show example
#set math.equation(numbering: "(1)")

We define:
$ phi.alt := (1 + sqrt(5)) / 2 $ <ratio>

With @ratio, we get:
$ F_n = floor(1 / sqrt(5) phi.alt^n) $
Preview

Default value:

none

number-align
Settable
Settable
Settable parameters can be set using the set rule, changing the default value used thereafter.

The alignment of the equation numbering.

By default, the alignment is end + horizon. For the horizontal component, you can use right, left, or start and end of the text direction; for the vertical component, you can use top, horizon, or bottom.

Show example
#set math.equation(numbering: "(1)", number-align: bottom)

We can calculate:
$ E &= sqrt(m_0^2 + p^2) \
    &approx 125 "GeV" $
Preview

Default value:

end + horizon

supplement
Settable
Settable
Settable parameters can be set using the set rule, changing the default value used thereafter.

A supplement for the equation.

For references to equations, this is added before the referenced number.

If a function is specified, it is passed the referenced equation and should return content.

Show example
#set math.equation(numbering: "(1)", supplement: [Eq.])

We define:
$ phi.alt := (1 + sqrt(5)) / 2 $ <ratio>

With @ratio, we get:
$ F_n = floor(1 / sqrt(5) phi.alt^n) $
Preview

Default value:

auto

alt
Settable
Settable
Settable parameters can be set using the set rule, changing the default value used thereafter.

An alternative description of the mathematical equation.

This should describe the full equation in natural language and will be made available to Assisitve Technology. You can learn more in the Textual Representations section of the Accessibility Guide.

Show example
#math.equation(
  alt: "integral from 1 to infinity of a x squared plus b with respect to x",
  $ integral_1^oo a x^2 + b med d x $,
)
Preview

Default value:

none

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 contents of the equation.

Open official docs

Search