How to customize the style of equation numbering?

Careful with counter.display() now. First of all, it’s probably enough to just move the context only before counter.display() but more importantly this now won’t work anymore with 0.12 and floating figures, see Wrong counter value when accessed from inside floating figure · Issue #4966 · typst/typst · GitHub.

This is technically correct as, according to @laurmaedje, it was kind of more luck that it even worked at all and now it doesn’t anymore. The correct solution would be to pass the location of figure.caption to the counter with .at() but since .location() of figure.caption() returns none, the next best and (for now) correct way is to nest the figure.caption() show rule inside a figure show rule and use its location.

#show figure: fig => {
  show figure.caption: c => [
    #let fig-num = numbering(fig.numbering, ..c.counter.at(fig.location()))
    *#it.supplement #fig-num#it.separator* #it.body
  ]
  fig
}