How do I make a reference that inserts name of section, and page number?

Here is a possible solution:

#show ref: it => if it.element.func() != heading { it } else {
  let l = it.target // label
  let h = it.element // heading
  link(l, [#h.body (p. #h.location().page())])
}

A reference to @paper4

#lorem(100)

// #pagebreak() // This will change "(p. 1)" to "(p. 2)".

= Manuscript IV
<paper4>

#lorem(20)

image

If you have the heading on the 2nd page:image

4 Likes