feat: add support for multiple authors

This commit is contained in:
Sven Vogel 2024-11-19 11:14:04 +01:00
parent 415fafc7f4
commit 9b90660353
5 changed files with 74 additions and 40 deletions

View File

@ -18,16 +18,28 @@
// Adds preleminarry note page and watermark // Adds preleminarry note page and watermark
draft: true, draft: true,
// information about author(s) // information about author(s)
author: ( university: (
name: "Sven Vogel",
semester: 4,
program: "Informationtechnology", program: "Informationtechnology",
course: "TINF19IT1",
faculty: "Technik", faculty: "Technik",
university: "DHBW Mannheim", name: "dualen Hochschule Baden-Württemberg",
campus: "Eppelheim"
),
authors: (
(
name: "Sven Vogel",
course: "TINF19IT1",
company: "ABB AG", company: "ABB AG",
supervisor: "Benny Goodman", supervisor: "Benny Goodman",
matriculation-number: 123456789), matriculation-number: 123456789
),
(
name: "Kurt Jammer",
course: "TINF24AI2",
company: "Siemens",
supervisor: "Henry Badman",
matriculation-number: 478568763
),
),
// information about thesis // information about thesis
thesis: ( thesis: (
title: "Unofficial ABB/DHBW Typst template", title: "Unofficial ABB/DHBW Typst template",
@ -87,7 +99,9 @@
if key in update { if key in update {
let update_val = update.at(key) let update_val = update.at(key)
if type(val) == dictionary and type(update_val) == dictionary { if type(val) == array {
// ignore checking arraay
} else if type(val) == dictionary and type(update_val) == dictionary {
base.insert(key, deep-insert-checked(val, update_val)) base.insert(key, deep-insert-checked(val, update_val))
} else if val == none or type(val) == type(update_val) { } else if val == none or type(val) == type(update_val) {
base.insert(key, update_val) base.insert(key, update_val)

View File

@ -71,7 +71,7 @@
// set document properties // set document properties
#set document( #set document(
author: config.author.name, // author: config.author.name,
keywords: config.thesis.keywords, keywords: config.thesis.keywords,
title: config.thesis.title, title: config.thesis.title,
) )

View File

@ -12,7 +12,6 @@
pagebreak(weak: true) pagebreak(weak: true)
let thesis = config.thesis let thesis = config.thesis
let author = config.author
if text.lang == "de" [ if text.lang == "de" [
#heading(level: 1, "Sperrvermerk") #heading(level: 1, "Sperrvermerk")

View File

@ -12,7 +12,6 @@
pagebreak(weak: true) pagebreak(weak: true)
let thesis = config.thesis let thesis = config.thesis
let author = config.author
if text.lang == "de" [ if text.lang == "de" [
#heading("Selbständigkeitserklärung") #heading("Selbständigkeitserklärung")

View File

@ -10,7 +10,6 @@
context [ context [
#let thesis = config.thesis #let thesis = config.thesis
#let author = config.author
#set align(center) #set align(center)
@ -31,13 +30,9 @@
// faculty // faculty
#pad()[ #pad()[
#if text.lang == "de" [ #if text.lang == "de" [
Praxisphase des #author.semester Semesters an der Fakultät für #author.faculty aus dem Studiengang #config.university.program | #config.university.faculty
#linebreak()
im Studiengang #author.program
] else if text.lang == "en" [ ] else if text.lang == "en" [
Practical phase of the #author.semester semester at the Faculty of #author.faculty from the course of studies #config.university.program | #config.university.faculty
#linebreak()
in the degree program #author.program
] else [ ] else [
#context panic("no translation for language: ", text.lang) #context panic("no translation for language: ", text.lang)
] ]
@ -52,41 +47,68 @@
] else [ ] else [
#context panic("no translation for language: ", text.lang) #context panic("no translation for language: ", text.lang)
] ]
#config.university.name
#linebreak() #linebreak()
#author.university #config.university.campus
]
#pad(top: 1em)[
#let names = ()
#for author in config.authors {
names.push(author.name)
}
#if text.lang == "de" [
von
] else if text.lang == "en" [
by
] else [
#context panic("no translation for language: ", text.lang)
]
#set text(size: 16pt)
#grid(columns: 1, row-gutter: 1em, ..names)
]
#pad(top: 1em)[
#thesis.timeframe
] ]
#set align(bottom + left) #set align(bottom + left)
#if text.lang == "de" [ #if text.lang == "de" [
#table( #grid(
columns: 2, columns: 2,
column-gutter: 1cm, column-gutter: 1cm,
align: left, row-gutter: 0.5cm,
align: top + left,
stroke: none, stroke: none,
[*Verfasser:*], author.name, [Matrikelnummer, Kurs:],
[*Bearbeitungszeitraum:*], thesis.timeframe, par(leading: 0.5em, for author in config.authors {
[*Matrikelnummer, Kurs:*], str(author.matriculation-number) + ", " + author.course
str(author.matriculation-number) + ", " + author.course, linebreak()
}),
[*Ausbildungsbetrieb:*], author.company, [Betrieb, Betreuer:],
[*Betrieblicher Betreuer:*], author.supervisor, par(leading: 0.5em, for author in config.authors {
[*Abgabedatum:*], thesis.submission-date, author.company + ", " + author.supervisor
linebreak()
}),
) )
] else if text.lang == "en" [ ] else if text.lang == "en" [
#table( #grid(
columns: 2, columns: 2,
column-gutter: 1cm, column-gutter: 1cm,
align: left, row-gutter: 0.5cm,
align: top + left,
stroke: none, stroke: none,
[*Author:*], author.name, [Student ID, Course:],
[*Editing period:*], thesis.timeframe, par(leading: 0.5em, for author in config.authors {
[*Matriculation number, course:*], str(author.matriculation-number) + ", " + author.course
str(author.matriculation-number) + ", " + author.course, linebreak()
}),
[*Training company:*], author.company, [Company, Supervisor:],
[*Company supervisor:*], author.supervisor, par(leading: 0.5em, for author in config.authors {
[*Submission date:*], thesis.submission-date, author.company + ", " + author.supervisor
linebreak()
}),
) )
] else [ ] else [
#context panic("no translation for language: ", text.lang) #context panic("no translation for language: ", text.lang)