Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 356
Makogan Avatar asked Sep 02 '26 17:09

Makogan


1 Answers

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 $)
like image 170
honkbug Avatar answered Sep 04 '26 16:09

honkbug



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!