From caa9cd87874d128342588cb20a170a78c4c70bdc Mon Sep 17 00:00:00 2001 From: Jean-Marie 'Histausse' Mineau Date: Sat, 20 Sep 2025 23:14:20 +0200 Subject: [PATCH] code to extract figures from main doc, will be usefull for slides --- figures.typ | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 figures.typ 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")