I have a figure with multiple panels A-D. In text I would like to reference single panels of this figure. I am aware, that typst won’t be able to reference the panels by itself, so I was wondering if there is a way to add the panel label to the figure reference. Something like: typ #ref(<Figure1>, panel = "A") , which would then result in Figure 1.A
The cases I tried so far are:
@Figure1 // The normal case
@Figure1 .A // This results into a space between the ref and .A
#link(<Figure1>)[Figure 1.A] // This has the desired result, however, the downside is that the label number would not get updated if I add another figure
If your figure contains a single image with no referenceable content, I am afraid your only solution remains manually writing the panels. If your issue was with how to reference the figure’s number, it is solved by calling the function ref.
#import "@preview/subpar:0.1.1"
#subpar.grid(
figure(rect(fill: red), caption: [
red block
]), <a>,
figure(rect(fill: blue), caption: [
blue block
]), <b>,
columns: (1fr, 1fr),
caption: [A figure composed of two sub figures.],
label: <full>,
)
Above in @full, we see a figure which is composed of two other figures, namely @a and @b.