Skip to content

Commit

Permalink
Add Registration Certificate (#44)
Browse files Browse the repository at this point in the history
Co-authored-by: Robert Jandow <[email protected]>
  • Loading branch information
janthoXO and robertjndw authored Jul 15, 2024
1 parent 6e81f4f commit 592806d
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-typst.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ jobs:
source_file: |
thesis.typ
proposal.typ
registration_certificate.typ
File renamed without changes
2 changes: 1 addition & 1 deletion layout/cover.typ
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

// --- Cover ---
v(1cm)
align(center, image("../figures/logo.png", width: 26%))
align(center, image("../figures/tum_logo.png", width: 26%))

v(5mm)
align(center, text(font: sans-font, 2em, weight: 700, "Technical University of Munich"))
Expand Down
69 changes: 69 additions & 0 deletions layout/registration_certificate.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#import "/utils/formfield.typ": *

#let registrationCertificate(
author: "",
birthdate: datetime,
title: "",
degree: "",
program: "",
supervisor: "",
startDate: datetime,
submissionDate: datetime,
currentDate: datetime,
body,
) = {

// Set the document's basic properties.
set page(
margin: (left: 20mm, right: 20mm, top: 20mm, bottom: 20mm),
)

// Save heading and body font families in variables.
let body-font = "New Computer Modern"
let sans-font = "New Computer Modern Sans"

// Set body font family.
set text(
font: body-font,
size: 12pt,
lang: "en"
)

align(
right,
stack(
dir: ttb,
spacing: 10pt,
image("/figures/tum_logo.png", width: 20%),
text(font: sans-font, weight: "bold", "Technical University \n of Munich")
)
)

v(1.5cm)

align(left, text(font: sans-font, 1.3em, weight: "bold", "Bestätigung zur Anmeldung der " + degree + "arbeit"))

grid(
columns: 2,
row-gutter: 10mm,
column-gutter: 6mm,
formField("Name der/des Studierenden", author, length: 90%),
formField("Geburtsdatum", birthdate.display("[day].[month].[year]"),length: 90%),
formField("Studiengang", program, length: 90%),
formField("Titel der Arbeit", title, length: 90%)
)

v(1.5cm)

"Hiermit bestätigen wir, dass der Kandidat/die Kandidatin sich am " + startDate.display("[day].[month].[year]") + " zur " + degree + "arbeit angemeldet hat. \n"
body

v(1.5cm)

grid(
columns: 2,
column-gutter: 2cm,
formField("Datum", currentDate.display("[day].[month].[year]"), length: 90%),
formField(supervisor, " ", length: 90%)
)
}
2 changes: 1 addition & 1 deletion layout/titlepage.typ
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

// --- Title Page ---
v(1cm)
align(center, image("/figures/logo.png", width: 26%))
align(center, image("/figures/tum_logo.png", width: 26%))

v(5mm)
align(center, text(font: sans-font, 2em, weight: 700, "Technical University of Munich"))
Expand Down
1 change: 1 addition & 0 deletions metadata.typ
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
#let supervisor = "Prof. Dr. Stephan Krusche"
#let advisors = ("Jolanda Krümelmonster, M.Sc.",)
#let author = "(Author)"
#let birthdate = datetime(day: 01, month: 01, year: 2002) // only necessary for registration certificate
#let startDate = datetime(day: 1, month: 1, year: 2024)
#let submissionDate = datetime(day: 1, month: 1, year: 2024)
18 changes: 18 additions & 0 deletions registration_certificate.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#import "/layout/registration_certificate.typ": *
#import "/metadata.typ": *

#set text(lang: "de")

#show: registrationCertificate.with(
author: author,
title: titleGerman,
birthdate: birthdate,
degree: degree,
program: program,
supervisor: supervisor,
startDate: startDate,
submissionDate: submissionDate,
currentDate: datetime.today(),
)

// You can write additional text for the registration certificate here.
9 changes: 9 additions & 0 deletions utils/formfield.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#let formField(label, content, length: 5cm) = {
stack(
text(1em, weight: "bold")[#content],
v(2mm),
line(length: length),
v(1mm),
text(0.9em, style: "italic")[#label]
)
}

0 comments on commit 592806d

Please sign in to comment.