I'm using run_autonum and block_caption from the officer package to create figure captions for my supplemental figures and then cross-reference them (want to be a separate series than the non-supplemental figures so the numbering restarts). The numbering in the figure caption is working great (1, 2, ...). However, when cross-referencing, the number shows up as 0.
Here's a reprex Rmd file:
---
title: "Untitled"
output:
officedown::rdocx_document
---
Supplemental figure \@ref(f-s1). Supplemental figure \@ref(f-s2)
```{r, echo=FALSE}
library(officer)
sfig_num <- run_autonum(seq_id = "sfig",
pre_label = "Figure S",
bkm="f-s1")
block_caption("A figure caption.",
style = "Image Caption",
autonum = sfig_num)
sfig_num <- run_autonum(seq_id = "sfig",
pre_label = "Figure S",
bkm="f-s2")
block_caption("A figure caption.",
style = "Image Caption",
autonum = sfig_num)
```
Here's a screenshot with correct caption numbering circled in blue; incorrect cross-reference numbering circled in red.