I have this to be able to reference to configuration parameters.
A show rule for ref which filters on the kind:
// References for parameters
#show ref: it => {
let el = it.element
if el != none and el.func() == figure and el.kind == "parameter" {
// just return the content of the label instead of a number
// e.g. "P00145.1"
//el.body (without link)
link(
el.location(),
el.body
)
} else {
// Other references as usual.
it
}
}
Then this function to define the configuration parameters:
// Parameters with references
#let cfg(par) = {
box([
#figure(
par, // content
caption: none,
kind: "parameter",
supplement: none
) #label(par.text)]) } ```
Then in my text I can just add tables with configuration parameters and reference them in the rest of the text.
The only remaining problem I have, is that I cannot click the reference to jump to the parameter table.
I suspect el.body removes the link.