From afe325da0a3492d9ac41b589e48ce0c3b74d38c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Mekina?= Date: Thu, 2 Oct 2025 13:45:09 +0200 Subject: [PATCH] fix error on no author --- example.typ | 6 +----- template/classic/common.typ | 4 +++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/example.typ b/example.typ index 4019d01..f250821 100644 --- a/example.typ +++ b/example.typ @@ -1,12 +1,8 @@ #import "template/template.typ": * #show: tultemplate2.with( - document: "bp", - faculty: "fm", - title: (cs: "Návod na použití Typst TUL šablony", en: lorem(10)), - abstract: (cs: [lorem(100)], en: [lorem(100)]), + title: (cs: "Návod na použití Typst TUL šablony"), author: "Ondřej Mekina, Matěj Žucha", - author_gender: "masculine", supervisor: "Ondřej Mekina", ) diff --git a/template/classic/common.typ b/template/classic/common.typ index 285dbd8..7abdf49 100644 --- a/template/classic/common.typ +++ b/template/classic/common.typ @@ -97,7 +97,9 @@ // [field_name, field_value, bold] let info_fields = ( ("study_programme", study_programme, false), - (if author.contains(", ") { "authors" } else { "author" }, author, true), + ( + if not is_none(author) and author.contains(", ") {"authors" } else { "author" }, author, true + ), ("supervisor", supervisor, false), ) context {