Zenn
Open2

TypstでReferenceを章ごとに番号付けする

3w36zj63w36zj6

https://github.com/typst/typst/issues/1896#issuecomment-2122861662

#set heading(numbering: "1.")

#show heading.where(level: 1): it => {
  counter(math.equation).update(0)
  counter(figure.where(kind: image)).update(0)
  counter(figure.where(kind: table)).update(0)
  counter(figure.where(kind: raw)).update(0)
  it
}
#set math.equation(numbering: (..num) =>
  numbering("(1.1)", counter(heading).get().first(), num.pos().first())
)
#set figure(numbering: (..num) =>
  numbering("1.1", counter(heading).get().first(), num.pos().first())
)
ログインするとコメントできます