From dd681be2da3c92fd2a3d00e3fd6ba707c57b768a Mon Sep 17 00:00:00 2001 From: Kristofers Solo Date: Tue, 24 Feb 2026 15:42:37 +0200 Subject: [PATCH] feat(documentary-page): make better documentary page for bachelor thesis --- src/documentary-page.typ | 98 ++++++++++++++++++++++++++++++++++++++++ src/lib.typ | 4 +- src/utils.typ | 70 +++++----------------------- 3 files changed, 113 insertions(+), 59 deletions(-) create mode 100644 src/documentary-page.typ diff --git a/src/documentary-page.typ b/src/documentary-page.typ new file mode 100644 index 0000000..6ed2e32 --- /dev/null +++ b/src/documentary-page.typ @@ -0,0 +1,98 @@ +#let signature-line(length: 6em) = box( + width: length, + stroke: (bottom: 0.5pt), + height: 0.65em, +) + +#let bachelor-dokumentary( + title, + authors, + advisors, + reviewer, + date, + presentation-date, +) = [ + Bakalaura darbs "*#title*" izstrādāts Latvijas Universitātes Eksakto zinātņu un + tehnoloģiju fakultātē. + + Ar savu parakstu apliecinu, ka darbs izstrādāts patstāvīgi, izmantoti tikai + tajā norādītie informācijas avoti un iesniegtā darba elektroniskā kopija + atbilst izdrukai. + #set par(hanging-indent: 1cm) + + #v(0.2fr) + + #if authors.len() > 1 { [Autori:\ ] } else { "Autors: " } + #( + authors + .map(author => [*#author.name, #author.code* ~#signature-line()~ #date]) + .join(", ") + ) + + #v(1fr) + Rekomendēju/nerekomendēju darbu aizstāvēšanai _(nederīgo svītro vadītājs)_\ + #if advisors.len() > 0 [ + #if advisors.len() > 1 { [Vadītāji:\ ] } else { "Vadītājs:" } + #( + advisors + .map( + advisor => [*#advisor.title #advisor.name* ~#signature-line()~ #date], + ) + .join("\n") + ) + ] + + #v(1fr) + + #if reviewer != none { + [Recenzents: *#reviewer.title #reviewer.name*] + v(1fr) + } + + + Darbs iesniegts Datorikas nodaļā #date \ + Pilnvarotā persona: vecākā metodiķe: Ārija Sproģe ~#signature-line() + + #v(1fr) + + Darbs aizstāvēts bakalaura gala pārbaudījuma komisijas sēdē ~#signature-line() \ + #presentation-date prot. Nr. #signature-line(length: 4em) \ + Komisijas sekretārs(-e): #signature-line(length: 15em) + + #v(1fr) +] + +#let fmt-date(date) = { + strong(date.display("[day].[month].[year].")) +} + +#let course-work-dokumentary = [] + +#let qualification-work-dokumentary = [] + +#let make-documentary-page( + title, + authors, + advisors, + reviewer, + thesis-type, + date, + presentation-date, +) = { + set page(numbering: none) + heading(level: 1, outlined: false, numbering: none, "Dokumentārā lapa") + set par(spacing: 2em) + let formatted-date = fmt-date(date) + let formatted-presentation-date = fmt-date(presentation-date) + + if thesis-type == "bachelor" { + bachelor-dokumentary( + title, + authors, + advisors, + reviewer, + formatted-date, + formatted-presentation-date, + ) + } +} diff --git a/src/lib.typ b/src/lib.typ index c46556c..c812d05 100644 --- a/src/lib.typ +++ b/src/lib.typ @@ -40,8 +40,9 @@ bibliography: none, university: "Latvijas Universitāte", faculty: [Eksakto zinātņu un tehnoloģiju fakultāte\ Datorikas nodaļa], - thesis-type: "Bakalaura darbs", + thesis-type: "bachelor", date: datetime.today(), + presentation-date: datetime.today(), place: none, logo: none, outline-title: "Saturs", @@ -309,6 +310,7 @@ reviewer, thesis-type, date, + presentation-date, ) } } diff --git a/src/utils.typ b/src/utils.typ index cbf9273..10cf0e7 100644 --- a/src/utils.typ +++ b/src/utils.typ @@ -1,3 +1,14 @@ +#import "documentary-page.typ": make-documentary-page + +#let get-thesis-type-name(thesis-type) = { + let thesis-types = ( + qualification: "Kvalifikācijas darbs", + course: "Kursa darbs", + bachelor: "Bakalaura darbs", + ) + thesis-types.at(thesis-type, default: str(thesis-type)) +} + #let merge(a, b) = { let result = a for (k, v) in b { result.at(k) = v } @@ -88,7 +99,7 @@ v(0.2fr) - align(center, upper(text(size: 14pt, thesis-type))) + align(center, upper(text(size: 14pt, get-thesis-type-name(thesis-type)))) v(1fr) @@ -112,63 +123,6 @@ align(center, upper([#place #date.year()])) } -#let make-documentary-page( - title, - authors, - advisors, - reviewer, - thesis-type, - date, -) = [ - #set page(numbering: none) - #let formatted-date = strong(date.display("[day].[month].[year].")) - - #heading(level: 1, outlined: false, numbering: none, "Dokumentārā lapa") - - #set par(spacing: 2em) - - #thesis-type "*#title*" izstrādāts Latvijas Universitātes Eksakto zinātņu un - tehnoloģiju fakultātē. - - Ar savu parakstu apliecinu, ka darbs izstrādāts patstāvīgi, izmantoti tikai - tajā norādītie informācijas avoti un iesniegtā darba elektroniskā kopija - atbilst izdrukai. - #set par(hanging-indent: 1cm) - - #v(0.2fr) - - #if authors.len() > 1 { "Autori: " } else { "Autors: " } - #( - authors.map(author => [*#author.name, #author.code*]).join(", ") - ) ~ #formatted-date - - #v(1fr) - Rekomendēju darbu aizstāvēšanai\ - #if advisors.len() > 0 [ - #if advisors.len() > 1 { "Vadītāji:" } else { "Vadītājs:" } - #( - advisors.map(advisor => [*#advisor.title #advisor.name*]).join("\n") - ) ~ #formatted-date - ] - - #v(1fr) - - #if reviewer != none { - [Recenzents: *#reviewer.title #reviewer.name*] - v(1fr) - } - - - Darbs iesniegts Datorikas nodaļā #formatted-date \ - Pilnvarotā persona: vecākā metodiķe: Ārija Sproģe #line(length: 10%, stroke: 0.5pt) - - #v(1fr) - - Darbs aizstāvēts bakalaura gala pārbaudījuma komisijas sēdē - - #v(1fr) -] - #let make-attachments(title, attachments) = { if attachments == () { return