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:
@@ -26,7 +26,7 @@ configure the whole document and `attachment` helper function. Important argumen
|
|||||||
`code` and may include `location` and `email`.
|
`code` and may include `location` and `email`.
|
||||||
- `advisors`: Array of advisor dictionaries with `title` and `name`.
|
- `advisors`: Array of advisor dictionaries with `title` and `name`.
|
||||||
- `reviewer`: Reviewer dictionary with `name`.
|
- `reviewer`: Reviewer dictionary with `name`.
|
||||||
- `thesis-type`: e.g., `"Bakalaura darbs"`, `"Kvalifikācijas Darbs"`.
|
- `thesis-type`: Type of thesis - `"bachelor"`, `"course"`, or `"qualification"`. The documentary page adapts its content based on this value.
|
||||||
- `date`: `datetime(...)` value for the thesis date. Defaults to `today`.
|
- `date`: `datetime(...)` value for the thesis date. Defaults to `today`.
|
||||||
- `place`: Place string (e.g., `"Rīga"`).
|
- `place`: Place string (e.g., `"Rīga"`).
|
||||||
- `abstract`: A record with `primary` and `secondary` abstracts. Each has
|
- `abstract`: A record with `primary` and `secondary` abstracts. Each has
|
||||||
@@ -48,7 +48,7 @@ function in a show rule. If you want to change an existing project to use this
|
|||||||
template, you can add a show rule like this at the top of your file:
|
template, you can add a show rule like this at the top of your file:
|
||||||
|
|
||||||
```typst
|
```typst
|
||||||
#import "@preview/solo-lu-df:1.0.0": *
|
#import "@preview/solo-lu-df:1.1.0": *
|
||||||
|
|
||||||
#show: ludf.with(
|
#show: ludf.with(
|
||||||
title: "Darba Nosaukums",
|
title: "Darba Nosaukums",
|
||||||
@@ -58,7 +58,7 @@ template, you can add a show rule like this at the top of your file:
|
|||||||
advisors: (
|
advisors: (
|
||||||
(title: "Mg. dat.", name: "Ivars Ozoliņš"),
|
(title: "Mg. dat.", name: "Ivars Ozoliņš"),
|
||||||
),
|
),
|
||||||
reviewer: (name: "Prof. Anna Liepa"),
|
reviewer: (title: "", name: "Prof. Anna Liepa"),
|
||||||
date: datetime(year: 2025, month: 1, day: 1),
|
date: datetime(year: 2025, month: 1, day: 1),
|
||||||
place: "Rīga",
|
place: "Rīga",
|
||||||
bibliography: bibliography("bibliography.yml"),
|
bibliography: bibliography("bibliography.yml"),
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#import "@preview/fletcher:0.5.8" as fletcher: diagram, edge, node
|
#import "@preview/fletcher:0.5.8" as fletcher: diagram, edge, node
|
||||||
#import "@preview/solo-lu-df:1.0.0": *
|
#import "@preview/solo-lu-df:1.1.0": *
|
||||||
#import "utils/diagrams.typ": data-store, dpd-database, dpd-edge, process
|
#import "utils/diagrams.typ": data-store, dpd-database, dpd-edge, process
|
||||||
#import "utils/tables.typ": function-table
|
#import "utils/tables.typ": function-table
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#show: ludf.with(
|
#show: ludf.with(
|
||||||
title: "Darba Nosaukums",
|
title: "Darba Nosaukums",
|
||||||
thesis-type: "Kvalifikācijas Darbs",
|
thesis-type: "qualification",
|
||||||
authors: (
|
authors: (
|
||||||
(
|
(
|
||||||
name: "Jānis Bērziņš",
|
name: "Jānis Bērziņš",
|
||||||
|
|||||||
@@ -4,72 +4,119 @@
|
|||||||
height: 0.65em,
|
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,
|
title,
|
||||||
authors,
|
authors,
|
||||||
advisors,
|
advisors,
|
||||||
reviewer,
|
reviewer,
|
||||||
|
thesis-type,
|
||||||
date,
|
date,
|
||||||
presentation-date,
|
presentation-date,
|
||||||
) = [
|
) = {
|
||||||
Bakalaura darbs "*#title*" izstrādāts Latvijas Universitātes Eksakto zinātņu un
|
let (intro-suffix, footer) = if thesis-type == "bachelor" {
|
||||||
tehnoloģiju fakultātē.
|
(
|
||||||
|
"",
|
||||||
|
[
|
||||||
|
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
|
#v(1fr)
|
||||||
tajā norādītie informācijas avoti un iesniegtā darba elektroniskā kopija
|
|
||||||
atbilst izdrukai.
|
|
||||||
#set par(hanging-indent: 1cm)
|
|
||||||
|
|
||||||
#v(0.2fr)
|
Darbs aizstāvēts bakalaura gala pārbaudījuma komisijas sēdē ~#signature-line() \
|
||||||
|
#presentation-date prot. Nr. #signature-line(length: 4em) \
|
||||||
#if authors.len() > 1 { [Autori:\ ] } else { "Autors: " }
|
Komisijas sekretārs(-e): #signature-line(length: 15em)
|
||||||
#(
|
],
|
||||||
authors
|
)
|
||||||
.map(author => [*#author.name, #author.code* ~#signature-line()~ #date])
|
} else if thesis-type == "course" {
|
||||||
.join(", ")
|
(
|
||||||
)
|
" un/vai recenzentam uzrādītajai darba versijai",
|
||||||
|
[
|
||||||
#v(1fr)
|
Darbs iesniegts Datorikas nodaļā #date \
|
||||||
Rekomendēju/nerekomendēju darbu aizstāvēšanai _(nederīgo svītro vadītājs)_\
|
Kursa darbu pārbaudīja komisijas sekretārs (elektronisks paraksts)
|
||||||
#if advisors.len() > 0 [
|
],
|
||||||
#if advisors.len() > 1 { [Vadītāji:\ ] } else { "Vadītājs:" }
|
)
|
||||||
#(
|
} else {
|
||||||
advisors
|
(
|
||||||
.map(
|
" un/vai recenzentam uzrādītajai darba versijai",
|
||||||
advisor => [*#advisor.title #advisor.name* ~#signature-line()~ #date],
|
[
|
||||||
)
|
Darbs iesniegts Datorikas nodaļā #date \
|
||||||
.join("\n")
|
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() \
|
#v(0.2fr)
|
||||||
#presentation-date prot. Nr. #signature-line(length: 4em) \
|
|
||||||
Komisijas sekretārs(-e): #signature-line(length: 15em)
|
|
||||||
|
|
||||||
#v(1fr)
|
#if authors.len() > 1 [Autori:\ ] else [Autors: ]
|
||||||
]
|
#(
|
||||||
|
authors
|
||||||
|
.map(it => [*#it.name, #it.code* ~#signature-line()~ #date])
|
||||||
|
.join(", ")
|
||||||
|
)
|
||||||
|
|
||||||
#let fmt-date(date) = {
|
#v(1fr)
|
||||||
strong(date.display("[day].[month].[year]."))
|
|
||||||
|
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(
|
#let make-documentary-page(
|
||||||
title,
|
title,
|
||||||
authors,
|
authors,
|
||||||
@@ -82,17 +129,14 @@
|
|||||||
set page(numbering: none)
|
set page(numbering: none)
|
||||||
heading(level: 1, outlined: false, numbering: none, "Dokumentārā lapa")
|
heading(level: 1, outlined: false, numbering: none, "Dokumentārā lapa")
|
||||||
set par(spacing: 2em)
|
set par(spacing: 2em)
|
||||||
let formatted-date = fmt-date(date)
|
|
||||||
let formatted-presentation-date = fmt-date(presentation-date)
|
|
||||||
|
|
||||||
if thesis-type == "bachelor" {
|
make-dokumentary(
|
||||||
bachelor-dokumentary(
|
title,
|
||||||
title,
|
authors,
|
||||||
authors,
|
advisors,
|
||||||
advisors,
|
reviewer,
|
||||||
reviewer,
|
thesis-type,
|
||||||
formatted-date,
|
fmt-date(date),
|
||||||
formatted-presentation-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 merge(a, b) = {
|
||||||
let result = a
|
let result = a
|
||||||
@@ -99,7 +91,7 @@
|
|||||||
|
|
||||||
v(0.2fr)
|
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)
|
v(1fr)
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#import "@preview/solo-lu-df:1.0.0": *
|
#import "@preview/solo-lu-df:1.1.0": *
|
||||||
|
|
||||||
#show: ludf.with(
|
#show: ludf.with(
|
||||||
title: "Darba Nosaukums",
|
title: "Darba Nosaukums",
|
||||||
|
|||||||
Reference in New Issue
Block a user