From 6c235907c27fa3bf5cffd72cb2cb419772e59346 Mon Sep 17 00:00:00 2001 From: servostar Date: Fri, 29 Nov 2024 17:24:04 +0100 Subject: [PATCH 1/3] fix: remove second author from default configuration --- src/conf.typ | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/conf.typ b/src/conf.typ index 028f367..fd82d52 100644 --- a/src/conf.typ +++ b/src/conf.typ @@ -32,14 +32,7 @@ company: "ABB AG", supervisor: "Benny Goodman", matriculation-number: 123456789 - ), - ( - name: "Kurt Jammer", - course: "TINF24AI2", - company: "Siemens", - supervisor: "Henry Badman", - matriculation-number: 478568763 - ), + ) ), // information about thesis thesis: ( -- 2.40.1 From 793e31c87a506f476b7489f3ecab2816219dad7b Mon Sep 17 00:00:00 2001 From: servostar Date: Fri, 29 Nov 2024 18:26:01 +0100 Subject: [PATCH 2/3] feat: rework author section of titlepage --- src/conf.typ | 11 +---- src/pages/titlepage.typ | 106 ++++++++++++++++------------------------ template/main.typ | 27 ++++++---- 3 files changed, 60 insertions(+), 84 deletions(-) diff --git a/src/conf.typ b/src/conf.typ index fd82d52..131a294 100644 --- a/src/conf.typ +++ b/src/conf.typ @@ -25,15 +25,7 @@ campus: "Eppelheim" ), supervisor-signature: false, - authors: ( - ( - name: "Sven Vogel", - course: "TINF19IT1", - company: "ABB AG", - supervisor: "Benny Goodman", - matriculation-number: 123456789 - ) - ), + authors: ((),()), // information about thesis thesis: ( title: "Unofficial ABB/DHBW Typst template", @@ -95,6 +87,7 @@ if type(val) == array { // ignore checking arraay + base.insert(key, update_val) } else if type(val) == dictionary and type(update_val) == dictionary { base.insert(key, deep-insert-checked(val, update_val)) } else if val == none or type(val) == type(update_val) { diff --git a/src/pages/titlepage.typ b/src/pages/titlepage.typ index a91ff8c..41b8c4c 100644 --- a/src/pages/titlepage.typ +++ b/src/pages/titlepage.typ @@ -49,9 +49,17 @@ // faculty #pad()[ #if text.lang == "de" [ - aus dem Studiengang #config.university.program | #config.university.faculty + aus dem Studiengang #config.university.program ] else if text.lang == "en" [ - from the course of studies #config.university.program | #config.university.faculty + from the course of studies #config.university.program + ] else [ + #context panic("no translation for language: ", text.lang) + ] + + #if text.lang == "de" [ + an der Fakultät #config.university.faculty + ] else if text.lang == "en" [ + at the faculty of #config.university.faculty ] else [ #context panic("no translation for language: ", text.lang) ] @@ -68,14 +76,19 @@ ] #config.university.name #linebreak() + #if text.lang == "de" [ + in + ] else if text.lang == "en" [ + in + ] else [ + #context panic("no translation for language: ", text.lang) + ] #config.university.campus ] - #pad(top: 1em)[ + #pad(top: 1.5em)[ #let names = () - #for author in config.authors { - names.push(author.name) - } + #if text.lang == "de" [ von ] else if text.lang == "en" [ @@ -83,70 +96,33 @@ ] else [ #context panic("no translation for language: ", text.lang) ] - #set text(size: 16pt) - #grid(columns: 1, row-gutter: 1em, ..names) + + #v(1.5em) + + #let rows = int(config.authors.len() / 3 + 0.5) + + #for i in range(0, rows) { + let cols = calc.min(config.authors.len() - i * 3, 3) + + grid(columns: cols, column-gutter: 1.5em, ..config.authors.slice(i * 3, i * 3 + cols).map(author => + grid(columns: 1, row-gutter: 1em, + text(size: 1.25em, author.name), + text(size: 1em, author.company), + text(size: 1em, author.contact), + [ + #str(author.matriculation-number), + #author.course + ] + ))) + } ] - #pad(top: 1em)[ + #set align(bottom) + + #pad(top: 1.5em)[ #thesis.timeframe ] - #set align(bottom + left) - - #if text.lang == "de" [ - #grid( - columns: 2, - column-gutter: 1cm, - row-gutter: 0.5cm, - align: top + left, - stroke: none, - [Matrikelnummer, Kurs:], - par( - leading: 0.5em, - for author in config.authors { - str(author.matriculation-number) + ", " + author.course - linebreak() - }, - ), - - [Betrieb, Betreuer:], - par( - leading: 0.5em, - for author in config.authors { - author.company + ", " + author.supervisor - linebreak() - }, - ), - ) - ] else if text.lang == "en" [ - #grid( - columns: 2, - column-gutter: 1cm, - row-gutter: 0.5cm, - align: top + left, - stroke: none, - [Student ID, Course:], - par( - leading: 0.5em, - for author in config.authors { - str(author.matriculation-number) + ", " + author.course - linebreak() - }, - ), - - [Company, Supervisor:], - par( - leading: 0.5em, - for author in config.authors { - author.company + ", " + author.supervisor - linebreak() - }, - ), - ) - ] else [ - #context panic("no translation for language: ", text.lang) - ] - #if config.supervisor-signature { align( bottom, diff --git a/template/main.typ b/template/main.typ index a411caf..8048297 100644 --- a/template/main.typ +++ b/template/main.typ @@ -6,16 +6,23 @@ lang: "de", region: "de", draft: false, - author: ( - name: "Sven Vogel", - semester: 4, - program: "Informationtechnology", - course: "TINF19IT1", - faculty: "Technik", - university: "DHBW Mannheim", - company: "ABB AG", - supervisor: "Benny Goodman", - matriculation-number: 123456789, + authors: ( + ( + name: "Sven Vogel", + course: "TINF19IT1", + company: none, + supervisor: "Benny Goodman", + matriculation-number: 123456789, + contact: "sven.vogel123@web.de" + ), + ( + name: "Sven Vogel", + course: "TINF19IT1", + company: "ABB AG", + supervisor: "Benny Goodman", + matriculation-number: 123456789, + contact: "sven.vogel123@web.de" + ) ), thesis: ( title: "Unofficial ABB/DHBW Typst template", -- 2.40.1 From bb00c834084bdade202e9f28d5334dd0dbaaf758 Mon Sep 17 00:00:00 2001 From: servostar Date: Fri, 29 Nov 2024 18:31:54 +0100 Subject: [PATCH 3/3] style: run typstyle format --- src/pages/titlepage.typ | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/pages/titlepage.typ b/src/pages/titlepage.typ index 41b8c4c..faa8d19 100644 --- a/src/pages/titlepage.typ +++ b/src/pages/titlepage.typ @@ -102,19 +102,23 @@ #let rows = int(config.authors.len() / 3 + 0.5) #for i in range(0, rows) { - let cols = calc.min(config.authors.len() - i * 3, 3) + let cols = calc.min(config.authors.len() - i * 3, 3) - grid(columns: cols, column-gutter: 1.5em, ..config.authors.slice(i * 3, i * 3 + cols).map(author => - grid(columns: 1, row-gutter: 1em, - text(size: 1.25em, author.name), - text(size: 1em, author.company), - text(size: 1em, author.contact), - [ - #str(author.matriculation-number), - #author.course - ] - ))) - } + grid(columns: cols, column-gutter: 1.5em, ..config + .authors + .slice(i * 3, i * 3 + cols) + .map(author => grid( + columns: 1, + row-gutter: 1em, + text(size: 1.25em, author.name), + text(size: 1em, author.company), + text(size: 1em, author.contact), + [ + #str(author.matriculation-number), + #author.course + ], + ))) + } ] #set align(bottom) -- 2.40.1