feature/templae-rewrite #8

Merged
servostar merged 13 commits from feature/templae-rewrite into main 2024-07-01 18:21:30 +00:00
6 changed files with 267 additions and 61 deletions
Showing only changes of commit 381e8d5d42 - Show all commits

View File

@ -0,0 +1,49 @@
#let new_confidentiality_statement_page(
thesis,
author) = context [
#if text.lang == "de" [
#text(size: 20pt, weight: "semibold", font: "Montserrat", "Sperrvermerk")
] else if text.lang == "en" [
#text(size: 20pt, weight: "semibold", font: "Montserrat", "Confidentiality statement")
]
#if text.lang == "de" [
Der Inhalt der dieser Arbeit mit dem Thema
] else if text.lang == "en" [
The content of this work with the topic
]
#v(1em)
#set align(center)
*#thesis.title*
#thesis.subtitle
#set align(left)
#v(1em)
#set par(justify: true)
#if text.lang == "de" [
darf weder als Ganzes noch in Auszügen Personen außerhalb des Prüfungsprozesses und des Evalua-tionsverfahrens zugänglich gemacht werden, sofern keine anderslautende Genehmigung der Ausbildungsstätte vorliegt.
] else if text.lang = "en" [
may not be made accessible to persons outside the examination process and the evaluation procedure, either as a whole or in excerpts, unless otherwise authorized by the training institution.
]
#v(25%)
#grid(
// set width of columns
// we need two, so make both half the page width
columns: (50%, 50%),
row-gutter: 0.75em,
align(left, {line(length: 6cm)}),
align(left, {line(length: 6cm)}),
align(left, if text.lang == "de" [ Ort, Datum ] else if text.lang == "en" [ place, date ] else { panic("no translation for language: ", text.lang) }),
align(left, if text.lang == "de" [ Unterschrift ] else if text.lang == "en" [ Signature ] else { panic("no translation for language: ", text.lang) }))
]

View File

@ -0,0 +1,46 @@
#let new_declaration_of_authorship(thesis, author) = context [
#if text.lang == "de" [
#text(size: 20pt, weight: "semibold", font: "Montserrat", "Selbständigkeitserklärung")
] else if text.lang == "en" [
#text(size: 20pt, weight: "semibold", font: "Montserrat", "Declaration of authorship")
]
#v(1em)
#if text.lang == "de" [
Ich versichere hiermit, dass ich meine Prüfung mit dem Thema
] else if text.lang == "en" [
I hereby certify that I have passed my examination with the subject
]
#v(1em)
#set align(center)
*#thesis.title*
#thesis.subtitle
#set align(left)
#v(1em)
#set par(justify: true)
selbständig verfasst und keine anderen als die angegebenen Quellen und Hilfsmittel benutzt habe. Ich versichere zudem, dass die eingereichte elektronische Fassung mit der gedruckten Fassung übereinstimmt.
#v(25%)
#grid(
// set width of columns
// we need two, so make both half the page width
columns: (50%, 50%),
row-gutter: 0.75em,
align(left, {line(length: 6cm)}),
align(left, {line(length: 6cm)}),
align(left, if text.lang == "de" [ Ort, Datum ] else if text.lang == "en" [ place, date ] else { panic("no translation for language: ", text.lang) }),
align(left, if text.lang == "de" [ Unterschrift ] else if text.lang == "en" [ Signature ] else { panic("no translation for language: ", text.lang) }))
]

View File

@ -0,0 +1,41 @@
#let new_prerelease_note(thesis, author) = context [
#if text.lang == "de" [
#text(size: 20pt, weight: "semibold", font: "Montserrat", "Vorabfassung")
] else if text.lang == "en" [
#text(size: 20pt, weight: "semibold", font: "Montserrat", "Preliminary version")
]
#v(1em)
#if text.lang == "de" [
Bei dieser Ausgabe der Arbeit mit dem Thema
] else if text.lang == "en" [
This edition of the work with the subject
]
#v(1em)
#set align(center)
*#thesis.title*
#thesis.subtitle
#set align(left)
#v(1em)
#set par(justify: true)
#if text.lang == "de" [
handelt es sich _nicht_ um die fertige Fassung. Das Dokument kann Inhaltliche-, Grammatikalische- sowie Format-Fehler enthalten. Das Dokument ist im Rahmen der Aufgabenstellung von Seiten der #author.university nicht zur Bewertung freigegeben und ein anderer Verwendungszweck als eine Vorschau ist nicht gestattet.
] else if text.lang == "en" [
is _not_ the final version. The document may contain content, grammatical and format errors. The document is not released for evaluation by #author.university within the scope of the assignment and any use other than a preview is not permitted.
]
#v(1em)
#h(1em) #author.name, #datetime.today().display()
]

View File

@ -1,5 +1,7 @@
#let new_title_page() = [
#let new_title_page(
thesis,
author) = context [
#let LogoHeight = 1.5cm
@ -11,113 +13,112 @@
// we need two, so make both half the page width
columns: (50%, 50%),
// left align logo of ABB
align(left, image("../../res/svg/ABB.svg", height: LogoHeight)),
align(left, image("res/ABB.svg", height: LogoHeight)),
// right align logo of DHBW
align(right, image("../../res/svg/DHBW.svg", height: LogoHeight))
)
align(right, image("res/DHBW.svg", height: LogoHeight)))
// title
#v(2cm)
#prelude.title(prelude.info.titel)
#text(size: 2em, weight: "semibold", thesis.title)
// subtitle
#prelude.subtitle(prelude.info.untertitel)
#text(size: 1.5em, thesis.subtitle)
// type of paper
#v(1cm)
#prelude.largetext(prelude.info.typ)
#text(size: 1.5em, weight: "bold", thesis.kind)
// number of semester
#if prelude.format.language == "de" [
Praxisphase des #prelude.info.semester Studienjahrs
] else if prelude.format.language == "en" [
Practical phase of the #prelude.info.semester academic year
#if text.lang == "de" [
Praxisphase des #author.semester Studienjahrs
] else if text.lang == "en" [
Practical phase of the #author.semester academic year
] else [
#panic("no translation for language: ", prelude.format.language)
#context panic("no translation for language: ", text.lang)
]
// fakulty
// faculty
#pad(top: 0.5cm)[
#if prelude.format.language == "de" [
an der Fakultät für #prelude.info.fakultät
#if text.lang == "de" [
an der Fakultät für #author.faculty
#linebreak()
im Studiengang #prelude.info.studiengang
] else if prelude.format.language == "en" [
at the Faculty of #prelude.info.fakultät
im Studiengang #author.program
] else if text.lang == "en" [
at the Faculty of #author.faculty
#linebreak()
in the degree program #prelude.info.studiengang
in the degree program #author.program
] else [
#panic("no translation for language: ", prelude.format.language)
#context panic("no translation for language: ", text.lang)
]
]
// university
#pad(top: 0.5cm)[
#if prelude.format.language == "de" [
#if text.lang == "de" [
an der
] else if prelude.format.language == "en" [
] else if text.lang == "en" [
at
] else [
#panic("no translation for language: ", prelude.format.language)
#context panic("no translation for language: ", text.lang)
]
#linebreak()
#prelude.info.universität
#author.university
]
#set align(bottom + left)
#if prelude.format.language == "de" [
#if text.lang == "de" [
#table(
columns: 2,
column-gutter: 1cm,
align: left,
stroke: none,
"Verfasser:",
prelude.info.autor,
[*Verfasser:*],
author.name,
"Bearbeitungszeitraum:",
prelude.info.bearbeitungszeitraum,
[*Bearbeitungszeitraum:*],
thesis.timeframe,
"Matrikelnummer, Kurs:",
str(prelude.info.matrikelnummer) + ", " + prelude.info.studiengang,
[*Matrikelnummer, Kurs:*],
str(author.matriculation-number) + ", " + author.course,
"Ausbildungsbetrieb:",
prelude.info.betrieb,
[*Ausbildungsbetrieb:*],
author.company,
"Betrieblicher Betreuer:",
prelude.info.betreuer,
[*Betrieblicher Betreuer:*],
author.supervisor,
"Abgabedatum:",
prelude.info.abgabe
[*Abgabedatum:*],
thesis.submission-date
)
] else if prelude.format.language == "en" [
] else if text.lang == "en" [
#table(
columns: 2,
column-gutter: 1cm,
align: left,
stroke: none,
"Author:",
prelude.info.autor,
[*Author:*],
author.name,
"Editing period:",
prelude.info.bearbeitungszeitraum,
[*Editing period:*],
thesis.timeframe,
"Matriculation number, course:",
str(prelude.info.matrikelnummer) + ", " + prelude.info.studiengang,
[*Matriculation number, course:*],
str(author.matriculation-number) + ", " + author.course,
"Training company:",
prelude.info.betrieb,
[*Training company:*],
author.company,
"Company supervisor:",
prelude.info.betreuer,
[*Company supervisor:*],
author.supervisor,
"Submission date:",
prelude.info.abgabe
[*Submission date:*],
thesis.submission-date
)
] else [
#panic("no translation for language: ", prelude.format.language)
#context panic("no translation for language: ", text.lang)
]
#pad(
@ -126,19 +127,17 @@
// set width of columns
// we need two, so make both half the page width
columns: (60%, 40%),
align(left, if prelude.format.language == "de" [
align(left, if text.lang == "de" [
Unterschrift des betrieblichen Betreuers
] else if prelude.format.language == "en" [
] else if text.lang == "en" [
Signature of the company supervisor
] else [
#panic("no translation for language: ", prelude.format.language)
#context panic("no translation for language: ", text.lang)
]
),
align(right, {line(length: 6cm)})
)
)
#pagebreak()
#counter(page).update(1)
]

View File

@ -8,15 +8,53 @@
// License: MIT
// global style of document
#let global_styled_doc(doc: content) = [
#let global_styled_doc(doc: content) = context [
// set page geometry
// paper format of A4
#set page(
paper: "a4",
margin: (left: 3cm, right: 2cm, top: 2cm, bottom: 2cm))
margin: (left: 3cm, right: 2.5cm, top: 2.5cm, bottom: 2.5cm))
#set text(
size: 12pt,
ligatures: true,
hyphenate: true,
dir: ltr,
font: "Open Sans")
#show heading: set text(
font: "Montserrat",
weight: "semibold")
// Set header spacing
#show heading.where(level: 1): it => v(2em) + it + v(1em)
#show heading.where(level: 2): it => v(1em) + it + v(0.5em)
#show heading.where(level: 3): it => v(0.5em) + it + v(0.25em)
#set raw(tab-size: 4)
#doc
]
#let HeaderPaddingBottom = 3em
#let LogoHeight = 3em
#let HeaderUnderlinePaddingTop = 8pt
#let prelude_styled(doc: content, thesis) = context [
#set page(
header-ascent: HeaderUnderlinePaddingTop + HeaderPaddingBottom,
numbering: "I",
margin: (top: 2.5cm + LogoHeight + HeaderUnderlinePaddingTop + HeaderPaddingBottom),
header: [
#grid(
columns: (1fr, auto),
align: (horizon, bottom),
context [ _ #thesis.title _ ],
image("pages/res/DHBW.svg", height: LogoHeight)
)
#v(HeaderUnderlinePaddingTop - 1em)
#line(length: 100%)
])
#doc
]

View File

@ -10,15 +10,48 @@
// start of template pages and styles
#let dhbw-template(doc) = [
#import "style.typ": global_styled_doc
#import "style.typ": global_styled_doc, prelude_styled
// apply global style to every element in the argument content
#global_styled_doc(doc: [
#import "pages/titlepage.typ": new_title_page
#import "pages/declaration-of-authorship.typ": new_declaration_of_authorship
#import "pages/confidentiality-statement.typ": new_confidentiality_statement_page
#import "pages/prerelease-note.typ": new_prerelease_note
#set text(lang: "de", region: "de")
#let author = (
name: "Sven Vogel",
semester: 4,
program: "Informationstechnik",
course: "TINF22IT2",
faculty: "Technik",
university: "DHBW Mannheim",
company: "ABB AG",
supervisor: "Florian Miedniak",
matriculation-number: 1191225
)
#let thesis = (
title: "Konfiguration & Integration von PROFINET",
subtitle: "für die AC500 SPS",
submission-date: "20. März 2024",
timeframe: "1. Januar 2023 - 20. März 2024",
kind: "T2000"
)
// preppend title page
#new_title_page()
#new_title_page(thesis, author)
#prelude_styled(thesis, doc: [
#new_declaration_of_authorship(thesis, author)
#pagebreak()
#new_confidentiality_statement_page(thesis, author)
#pagebreak()
#new_prerelease_note(thesis, author)
])
// code of document follows here
#doc