mirror of
https://github.com/kristoferssolo/LU-DF-Typst-Template.git
synced 2026-03-22 00:26:23 +00:00
feat!: change thesis-type to accept short keys (bachelor/course/qualification)
BREAKING CHANGE: thesis-type now requires "bachelor", "course", or "qualification" instead of full labels like "Bakalaura darbs". Update existing documents to use the new format.
This commit is contained in:
@@ -4,72 +4,119 @@
|
||||
height: 0.65em,
|
||||
)
|
||||
|
||||
#let bachelor-dokumentary(
|
||||
#let fmt-date(date) = strong(date.display("[day].[month].[year]."))
|
||||
|
||||
#let thesis-config = (
|
||||
bachelor: (
|
||||
label: "Bakalaura darbs",
|
||||
intro-suffix: "",
|
||||
),
|
||||
course: (
|
||||
label: "Kursa darbs",
|
||||
intro-suffix: " un/vai recenzentam uzrādītajai darba versijai",
|
||||
),
|
||||
qualification: (
|
||||
label: "Kvalifikācijas darbs",
|
||||
intro-suffix: " un/vai recenzentam uzrādītajai darba versijai",
|
||||
),
|
||||
)
|
||||
|
||||
#let get-thesis-label(thesis-type) = {
|
||||
thesis-config.at(thesis-type, default: (label: str(thesis-type))).label
|
||||
}
|
||||
|
||||
#let make-dokumentary(
|
||||
title,
|
||||
authors,
|
||||
advisors,
|
||||
reviewer,
|
||||
thesis-type,
|
||||
date,
|
||||
presentation-date,
|
||||
) = [
|
||||
Bakalaura darbs "*#title*" izstrādāts Latvijas Universitātes Eksakto zinātņu un
|
||||
tehnoloģiju fakultātē.
|
||||
) = {
|
||||
let (intro-suffix, footer) = if thesis-type == "bachelor" {
|
||||
(
|
||||
"",
|
||||
[
|
||||
Darbs iesniegts Datorikas nodaļā #date \
|
||||
Pilnvarotā persona: vecākā metodiķe: Ārija Sproģe ~#signature-line()
|
||||
|
||||
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(1fr)
|
||||
|
||||
#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")
|
||||
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)
|
||||
],
|
||||
)
|
||||
} else if thesis-type == "course" {
|
||||
(
|
||||
" un/vai recenzentam uzrādītajai darba versijai",
|
||||
[
|
||||
Darbs iesniegts Datorikas nodaļā #date \
|
||||
Kursa darbu pārbaudīja komisijas sekretārs (elektronisks paraksts)
|
||||
],
|
||||
)
|
||||
} else {
|
||||
(
|
||||
" un/vai recenzentam uzrādītajai darba versijai",
|
||||
[
|
||||
Darbs iesniegts Datorikas nodaļā #date \
|
||||
Kvalifikācijas darbu pārbaudījumu komisijas sekretārs (elektronisks paraksts)
|
||||
],
|
||||
)
|
||||
]
|
||||
|
||||
#v(1fr)
|
||||
|
||||
#if reviewer != none {
|
||||
[Recenzents: *#reviewer.title #reviewer.name*]
|
||||
v(1fr)
|
||||
}
|
||||
|
||||
let work-label = if thesis-type == "bachelor" {
|
||||
"Bakalaura darbs"
|
||||
} else if thesis-type == "course" {
|
||||
"Kursa darbs"
|
||||
} else {
|
||||
"Kvalifikācijas darbs"
|
||||
}
|
||||
|
||||
Darbs iesniegts Datorikas nodaļā #date \
|
||||
Pilnvarotā persona: vecākā metodiķe: Ārija Sproģe ~#signature-line()
|
||||
[
|
||||
#work-label "*#title*" #if thesis-type == "bachelor" [izstrādāts] else [ir izstrādāts]
|
||||
Latvijas Universitātes Eksakto zinātņu un tehnoloģiju fakultātē.
|
||||
|
||||
#v(1fr)
|
||||
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#intro-suffix.
|
||||
#set par(hanging-indent: 1cm)
|
||||
|
||||
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(0.2fr)
|
||||
|
||||
#v(1fr)
|
||||
]
|
||||
#if authors.len() > 1 [Autori:\ ] else [Autors: ]
|
||||
#(
|
||||
authors
|
||||
.map(it => [*#it.name, #it.code* ~#signature-line()~ #date])
|
||||
.join(", ")
|
||||
)
|
||||
|
||||
#let fmt-date(date) = {
|
||||
strong(date.display("[day].[month].[year]."))
|
||||
#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(it => [*#it.title #it.name* ~#signature-line()~ #date])
|
||||
.join("\n")
|
||||
)
|
||||
]
|
||||
|
||||
#v(1fr)
|
||||
|
||||
#if reviewer != none [
|
||||
Recenzents: *#reviewer.title #reviewer.name*
|
||||
#v(1fr)
|
||||
]
|
||||
|
||||
#footer
|
||||
|
||||
#v(1fr)
|
||||
]
|
||||
}
|
||||
|
||||
#let course-work-dokumentary = []
|
||||
|
||||
#let qualification-work-dokumentary = []
|
||||
|
||||
#let make-documentary-page(
|
||||
title,
|
||||
authors,
|
||||
@@ -82,17 +129,14 @@
|
||||
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,
|
||||
)
|
||||
}
|
||||
make-dokumentary(
|
||||
title,
|
||||
authors,
|
||||
advisors,
|
||||
reviewer,
|
||||
thesis-type,
|
||||
fmt-date(date),
|
||||
fmt-date(presentation-date),
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
#import "documentary-page.typ": make-documentary-page
|
||||
#import "documentary-page.typ": get-thesis-label, 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
|
||||
@@ -99,7 +91,7 @@
|
||||
|
||||
v(0.2fr)
|
||||
|
||||
align(center, upper(text(size: 14pt, get-thesis-type-name(thesis-type))))
|
||||
align(center, upper(text(size: 14pt, get-thesis-label(thesis-type))))
|
||||
|
||||
v(1fr)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user