Hi,
When I try to reference a label using @test
, it’s not working properly. Here’s my code:
#set heading(numbering: "1.")
#outline(
indent: auto
)
#show link: underline
#show ref: it => {
let el = it.element
if el != none and el.func() == heading {
let nums = counter(heading).at(el.label)
link(el.location(), numbering(el.numbering, ..nums) + el.body)
}
}
= T1
== T2
#let name = "Test"
#let labelName = lower(name).replace(" ",":")
=== #name #label(labelName)
#lorem(10)
\
#name \
#labelName
=== Test 2 <test2>
This is reference for @test . Missing!!!
\
#lorem(10)
In my code, I’m trying to create a dynamic label using a variable name
and then reference it with @test
, but I get none in reference function. I have defined the label using #label(labelName)
where labelName
is created from the name
variable.
I’ve tried:
- Using
#ref("test")
instead of@test
- Checking if the label is properly created with
labelName
- Using an explicit label with
<test>
But none of these approaches worked. What am I doing wrong? How can I make the reference work correctly?