code to extract figures from main doc, will be usefull for slides
All checks were successful
/ test_checkout (push) Successful in 1m39s

This commit is contained in:
Jean-Marie 'Histausse' Mineau 2025-09-20 23:14:20 +02:00
parent 7f1a5430fb
commit caa9cd8787
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2

34
figures.typ Normal file
View file

@ -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")