I am using a grid layout to put two figures side by side.
Now if I want to reference one of the figures i cant since label only works inside a content block.
Any idea how to fix this, or is there a workaround?
#grid(
columns: (1fr, 1fr),
column-gutter: 0.5cm,
align: horizon,
figure(
rect(fill: red, width: 5cm),
caption: [Experimental setup for electron spin resonance.],
),
figure(
rect(fill: red, width: 5cm),
caption: [Arrangement of the Helmholtz coils and the ESR base unit, viewed from above.],
),
)
You can put content blocks inside the grid to wrap the figures. You can then add the labels inside those content blocks.
#grid(
columns: (1fr, 1fr),
column-gutter: 0.5cm,
align: horizon,
[
#figure(
rect(fill: red, width: 5cm),
caption: [Experimental setup for electron spin resonance],
) <experimental-setup>
],
[
#figure(
rect(fill: red, width: 5cm),
caption: [Arrangement of the Helmholtz coils and the ESR base unit, viewed from above.],
) <helmholtz-coils>
],
)
If you are adding a code example to your question, please make sure that it compiles without error. We don’t have access to your images and citations and they are also not related to your issue. Instead of images you can for example just put a rectangle inside the figures. See https://forum.typst.app/t/how-to-post-in-the-questions-category for more information on posting questions.