From dd8ed6e2f520d8e42d4d816b4f101a8f3d2a2f46 Mon Sep 17 00:00:00 2001 From: servostar Date: Mon, 22 Jul 2024 08:41:02 +0200 Subject: [PATCH] fixed error when lang of raw figure was empty --- src/style.typ | 9 +++++++-- template/appendix.typ | 5 +++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/style.typ b/src/style.typ index c9ddabe..511e7b5 100644 --- a/src/style.typ +++ b/src/style.typ @@ -81,6 +81,11 @@ show raw: set text(font: style.code.font, size: style.code.size) show figure.where(kind: raw): it => align(left)[ #let content = it.body + #let lang = if content.has("lang") { + it.body.lang + } else { + none + } #block( width: 100%, fill: ABB-GRAY-06, @@ -97,7 +102,7 @@ let (i, l) = e let n = i + 1 let n_str = if (calc.rem(n, 1) == 0) or (true and i == 0) { text(font: style.code.font, size: style.code.size, fill: ABB-BLACK, str(n)) } else { none } - (n_str + h(0.5em), raw(lang: content.lang, l)) + (n_str + h(0.5em), raw(lang: lang, l)) }) } else { @@ -105,7 +110,7 @@ ( left, ), e => { let (i, l) = e - raw( lang:content.lang, l) + raw( lang: lang, l) } ) } diff --git a/template/appendix.typ b/template/appendix.typ index 09e2c77..51cb42a 100644 --- a/template/appendix.typ +++ b/template/appendix.typ @@ -7,3 +7,8 @@ == More raw data #lorem(50) + +#figure( + ``` + ``` +) \ No newline at end of file