sitandr / typst-examples-book

Book of educational examples for Typst
https://sitandr.github.io/typst-examples-book/book
MIT License
190 stars 16 forks source link

Number by current heading #17

Closed laurmaedje closed 7 months ago

laurmaedje commented 7 months ago

Location: https://sitandr.github.io/typst-examples-book/book/snippets/math/numbering.html#numbering

Importance: The current math numbering snippet has two issues:

Snippet: The snippet below fixes that:

#set math.equation(numbering: n => {
  let h1 = counter(heading).get().first()
  numbering("(1.1)", h1, n)
})
sitandr commented 7 months ago

Thanks a lot!

I'm planning to update all possible snippets to new context system eventually on myself, not sure about time though.

Leedehai commented 7 months ago

Hi - please see the comment on https://github.com/sitandr/typst-examples-book/commit/4a6adffc2b1ea950c383f757c06b867fefb4ce38 :)