Prefix plot filenames with figure number in knitr/ #QuartoPub
```
knitr::opts_hooks$set(label = function(options) {
this_label <- knitr::opts_current$get("label")
if (!startsWith(this_label, "fig")) {
return(options)
}
all_chunks <- knitr::all_labels(startsWith(label, "fig"))
fig_num <- which(all_chunks == this_label)
n <- formatC(fig_num, width = 3, flag = "0")
new_path <- paste0(options$fig.path, n, "_")
options$fig.path <- new_path
return(options)
})
```



