diff --git a/figures.typ b/figures.typ new file mode 100644 index 0000000..aeb1c9e --- /dev/null +++ b/figures.typ @@ -0,0 +1,34 @@ +#show link: it => if type(it.dest) == label { + context { + if query(it.dest).len() == 0 { + it.body + } else { + it + } + } +} else { + it +} + +#let get_figures(body) = { + if type(body) == array { + body.map(get_figures).flatten() + } else if type(body) == dictionary { + body.values().map(get_figures).flatten() + } else if type(body) != content { + () + }else if body.func() == figure { + (body,) + } else { + body.fields().values().map(get_figures).flatten() + } +} + +#let main = include("./main.typ") +#let figs = get_figures(main) +// #repr(figs) +#for f in figs { + f +} + +#bibliography("bibliography.bib")