code to extract figures from main doc, will be usefull for slides
All checks were successful
/ test_checkout (push) Successful in 1m39s
All checks were successful
/ test_checkout (push) Successful in 1m39s
This commit is contained in:
parent
7f1a5430fb
commit
caa9cd8787
1 changed files with 34 additions and 0 deletions
34
figures.typ
Normal file
34
figures.typ
Normal 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")
|
Loading…
Add table
Add a link
Reference in a new issue