Hi,
I am learning Typst (explains probable beginners mistakes below) and I am writing a template that includes writing tables of requirements.
I would like to be able to reference individual requirements, i.e., put a label on selected requirements and be able to reference them like
@req_ui implies ...
=> Req. 2 implies
I have tried with creating a custom kind (in a figure function call) as I understand Reference Function – Typst Documentation, but I can’t really get it to work with the table.
My question is then simply: What is the (best) way to achieve this functionality?
The table below is a minimal example similar to what I am aiming for:
#let req_counter = counter("req")
#req_counter.update(1)
#table(columns: (auto, auto, auto),
align: (center, left, center),
stroke: none,
table.hline(stroke: 0.75pt, position: bottom),
table.header([*No*], [*Requirement*], [*Priority*]),
[#context req_counter.display() #req_counter.step()],
[A requirement on computational load],
[1],
[#context req_counter.display() #req_counter.step()],
[A requirement on UI],
[2],
)
Best,
Erik
Edit:
I tried something like this (with a custom show rule)
#figure(kind: "req", supplement: "Req.", context req_counter.display())<b>
@b
and then the reference is OK but I can’t get this to work with the table of requirements.