How to show figure numbering prefix when referencing the figure?

Hi!

I want to have a prefix for the numbering of my figures and tables in the Supplementary Material (i.e. appendix) at the end of my manuscript. This seemed simple enough given the numbering parameter in figure supporting prefixes. However, the prefix only shows up in the figure label and not in the reference.

Have I missed something or is this a bug?

Minimal example:

#set figure(numbering: "S1")

@figure

#figure(
  box[Figure],
  caption: [This is a figure.],
) <figure>

Expected output for the reference “Figure S1”.

This is indeed a bug. You’ve ran into Reference does not render custom Figure numbering · Issue #3089 · typst/typst · GitHub. Typst currently trims some of the numbering when you reference something.

Ah, I missed that somehow when looking through the issues. Thank you! For anyone else wondering, the fix is to replace:

#set figure(numbering: "S1")

with:

#set figure(numbering: n => [S#n])

Hey @Peter, welcome to the forum! I’ve updated your post’s title to better suit our guidelines: How to post in the Questions category

Make sure the title is a question you’d ask to a friend about Typst. :wink:

1 Like