From 2d67b11f48a6da97bd045718e1755f954a9119ef Mon Sep 17 00:00:00 2001 From: Anton Bilous Date: Mon, 17 Feb 2025 18:23:36 +0200 Subject: [PATCH] pass named arguments for img to image --- template.typ | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/template.typ b/template.typ index c3b2294..f2b59e1 100644 --- a/template.typ +++ b/template.typ @@ -60,10 +60,11 @@ /// - "img/image.png" = @image /// - "img/foo/image.png" = @foo_image /// - "img/foo/foo_image.png" = @foo_image -/// the caption will be modified based on a conditional value: +/// the caption will be modified based on a conditional positional value: /// - `none`: no change /// - some value: "`caption` (за даними `value`)" /// - no value: "`caption` (рисунок виконано самостійно)" +/// additional named arguments will be passed to original `image` function #let img(path, caption, ..sink) = { let parts = path.split(".").first().split("/") @@ -83,7 +84,7 @@ [#caption (за даними #sink.pos().first())] } - [#figure(image(path), caption: caption) #label(label_string)] + [#figure(image(path, ..sink.named()), caption: caption) #label(label_string)] } // Styling {{{1