How to remove a customized numbering's suffixes from heading references?

I am trying to remove the first number on the numbering of a header with a numbering function. The numbering of a header changes correctly with a function, but the behavior of the modified numbering is different on references: it keeps the suffix.

#set page(width: 12cm, margin: 1cm, height: auto)

#set heading(numbering: "1.", supplement: [Content])

= Heading example <ref.main>
See the @ref.main. There isn't any additional dot.

= Appendix
The desired behavior is that the numbering of headings
with number "X.Y" to be "Y." and the reference "Appendix Y".

#set heading(
  offset: 1, supplement: [Appendix],
  // This numbering function shows the reference with a dot at the end
  numbering: (..numbs) => numbering("1.1.", ..numbs.pos().slice(1))
)
= Problem example <ref.appendix>
See the @ref.appendix. An additional dot was added.

#set heading(offset: 1, supplement: [Appendix], numbering: "1.1.")
= Example without removing offset <ref.appendix-without-removing-offset>
See the @ref.appendix-without-removing-offset. No additional dot was added.

image

Is there a way to keep the same heading numbering behavior with a custom numbering function (that removed the first number)?

Hey @benjavicente! I’ve changed your question post’s title to better fit our guidelines: How to post in the Questions category

For future posts, please make sure your title is a question you’d ask to a friend about Typst. :wink: