I have a document in which I add images. I'd like all the images (appendices) I've added to my document to be duplicated in the same format in a dedicated section to group together all the document's appendices. For example when I add my figure (which can be a table, image, ...) #figure(...)<myimage> I would like to show the image, be able to still use the reference in my text with @myimage and then to have it duplicated into my section "All Images" of my document.
I've tried to use state in my template like bellow, but it only show the reference, not the image with the caption and everything.
main.typ
#appendix[
#figure(
image("myimage.png"),
caption: [myimage]
)<myimage>
]
template.typ
#let appendixes = state("appendixes", ())
[...] // Some other style
for body in appendixes.final(loc) {
body
}
[...]
#let appendix(body) = appendixes.update(it => it + (body,))
Anyone would have a clue on how I can achieve this ?