appearance of references to images

This commit is contained in:
2025-02-09 13:52:50 +02:00
parent 0e58f53e47
commit 1a2dc26b97

View File

@ -15,14 +15,14 @@
/// bold text
#let bold(content) = text(weight: "bold")[#content]
/// insert fig with label and caption
#let fig(path, caption) = {
figure(
/// captioned image with label derived from path
#let img(path, caption) = [
#figure(
image(path),
caption: caption,
)
label(path.split("/").last().split(".").first())
}
#label(path.split("/").last().split(".").first())
]
/// subjects list
#let subjects = (
@ -113,6 +113,19 @@
},
)
// appearance of references to images
show ref: it => {
let el = it.element
if el != none and el.kind == image {
link(
el.location(),
[(див. рис. #numbering(el.numbering))],
)
} else {
it
}
}
// TODO: Maybe this will be better. Must be investigated.
//
// set math.equation(numbering: (..num) =>
@ -607,4 +620,3 @@
heading(title)
doc
}