From f0eea081bf4ce7493410f06a3b09f724622e337e Mon Sep 17 00:00:00 2001 From: Anton Bilous Date: Tue, 11 Feb 2025 09:21:25 +0200 Subject: [PATCH 1/3] fix appearance of references --- template.typ | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/template.typ b/template.typ index 6f8a866..4ccaa98 100644 --- a/template.typ +++ b/template.typ @@ -118,17 +118,26 @@ }, ) - // appearance of references to images + // appearance of references to images and tables show ref: it => { let el = it.element - if el != none and el.kind == image { - link( - el.location(), - [(див. рис. #numbering(el.numbering))], - ) - } else { - it + + if el == none or not el.has("kind") { + return 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. From 0153fa1a2f9002e0528101c28afd5d60a18e243d Mon Sep 17 00:00:00 2001 From: Anton Bilous Date: Tue, 11 Feb 2025 10:26:22 +0200 Subject: [PATCH 2/3] show table captions at the top --- template.typ | 2 ++ 1 file changed, 2 insertions(+) diff --git a/template.typ b/template.typ index 4ccaa98..535df53 100644 --- a/template.typ +++ b/template.typ @@ -117,6 +117,8 @@ context str(counter(heading).get().at(0)) + "." + context tab.display() }, ) + set figure.caption(position: top) + // TODO: left align the caption // appearance of references to images and tables show ref: it => { From 671602f4b407168788033018d9222a27bf6433ad Mon Sep 17 00:00:00 2001 From: Anton Bilous Date: Tue, 11 Feb 2025 11:54:19 +0200 Subject: [PATCH 3/3] move caption only for tables --- template.typ | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/template.typ b/template.typ index 535df53..2b6b0e9 100644 --- a/template.typ +++ b/template.typ @@ -117,8 +117,7 @@ context str(counter(heading).get().at(0)) + "." + context tab.display() }, ) - set figure.caption(position: top) - // TODO: left align the caption + show figure.where(kind: table): set figure.caption(position: top) // TODO: left align the caption // appearance of references to images and tables show ref: it => {