#Override reference format only for headings

4 messages · Page 1 of 1 (latest)

true phoenix
#

The goal is make everything besides headings reference in their default manner without having to manually type it out here.

#set ref(supplement: it => {
  if it.func() == heading {
    "§"
  } else {
    // default
  }
})

I tried using a show rule, but wasn't having much luck.

#show ref.where(
  supplement: [Section]
): it => [
  §
]
cinder drift
#

?render

#show ref: it => {
  if it.element != none and it.element.func() == heading {
    strong[special heading ref]
  } else {
    it
  }
}

#set heading(numbering: "1.1")


== A heading <lbl1>
#figure(caption: [a figure])[figure content] <lbl2>

Let's reference the heading: @lbl1

And now the figure: @lbl2
cinder drift