mathmarkuptypesettingmathematical-typesettingtypst

Numbered equations with typst?


Typst's documentation says that there is an equation function you can use to write numbered equations.

However when I write:

#equation($a$)

I get an error saying no such symbol can be found.


Solution

  • If you want all equations numbered:

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

    If you want just one equation numbered:

    #math.equation(block: true, numbering: "(1)", $a^2$ )
    

    There is probably a better way of doing the second, since you're putting an equation inside an equation, which will break the numbering if you try to use the first and second together.

    Also if you do the second method, it might be worth putting it in a function in case you ever want to change the numbering:

    #let numbered_eq(content) = math.equation(
        block: true,
        numbering: "(1)",
        content,
    )
    #numbered_eq($ a^2 $)