forked from pencelheimer/typst_nure_template
Merge pull request 'table references and captions' (#3) from 0x1D8/typst_nure_template:main into main
Reviewed-on: pencelheimer/typst_nure_template#3
This commit is contained in:
26
template.typ
26
template.typ
@ -117,18 +117,28 @@
|
|||||||
context str(counter(heading).get().at(0)) + "." + context tab.display()
|
context str(counter(heading).get().at(0)) + "." + context tab.display()
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
show figure.where(kind: table): set figure.caption(position: top) // TODO: left align the caption
|
||||||
|
|
||||||
// appearance of references to images
|
// appearance of references to images and tables
|
||||||
show ref: it => {
|
show ref: it => {
|
||||||
let el = it.element
|
let el = it.element
|
||||||
if el != none and el.kind == image {
|
|
||||||
link(
|
if el == none or not el.has("kind") {
|
||||||
el.location(),
|
return it
|
||||||
[(див. рис. #numbering(el.numbering))],
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
it
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let el_name = if el.kind == image {
|
||||||
|
"рис."
|
||||||
|
} else if el.kind == table {
|
||||||
|
"таблицю"
|
||||||
|
} else {
|
||||||
|
return it
|
||||||
|
}
|
||||||
|
|
||||||
|
link(
|
||||||
|
el.location(),
|
||||||
|
[(див. #el_name #numbering(el.numbering))],
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Maybe this will be better. Must be investigated.
|
// TODO: Maybe this will be better. Must be investigated.
|
||||||
|
Reference in New Issue
Block a user