How to get the title with its name?

This question is part of the How to get the entire title when referencing headings?, which was already answered.

Consider this:

#set heading(numbering: "1.")

#let refName(
  label
) = {
  ref(label, supplement: it => {
      if it != none and it.func() == heading {
        link(it.location(), it.body)
      }
    }
  )
}

= Introduction

== Introduction Title <intro>

This is the introduction.

= Background

== Background

This is the background. And intro is #refName(<intro>).

This gives me an output as

image

But the referenced title also shows the number, is it possible to just get the title and not it’s number?

You can either adapt the solution from the thread you linked:

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

or use query, to get and display the title.

#let refName(label) = context {
  let el = query(label).first()
  link(el.location(), el.body)
}