How to remove the displayed number after custom name in a reference?

Hello, I’m new to Typst. I want to reference a chapter (with label).
@label produces only the Chapter Number, Ok.
@label[custom name] produces “custom name + [chapter number]”, but why with the chapter number?

#show ref: it => {
  let el = it.element
  if el != none and el.func() == heading {
    link(el.location(), el.body)
  }
}

from a different post here and this works. BUT, then citation from bibtex isnt working anymore.

Thank you.

Hi @Veganer,

in your code only references of headings are handled, you need to allow a default for all other reference types.

#show ref: it => {
  let el = it.element
  if el != none and el.func() == heading {
    link(el.location(), el.body)
  } else {
    it
  }
}

Could you please, change your title to a question

and use a code block, like this:

```typst
your code
```
3 Likes

Because it’s designed to customize the supplement (e.g. Chap. or Part), not the whole reference.

If you only want to link to a chapter with an arbitrary name, and do not care about the number of that chapter, then creating a link directly is more straightforward.
Please refer to the example in the docs of link.dest.

= Introduction <intro>

= Next chapter
#link(<intro>)[Go to intro]

2 Likes