diff --git a/conf/bibliography.bib b/conf/bibliography.bib new file mode 100644 index 0000000..5553e2b --- /dev/null +++ b/conf/bibliography.bib @@ -0,0 +1,3 @@ +% Bibliography based on BibTeX +% format: https://www.bibtex.com/g/bibtex-format/ +% possible entry types: https://www.bibtex.com/e/entry-types/ diff --git a/conf/format.yaml b/conf/format.yaml new file mode 100644 index 0000000..afcf2ac --- /dev/null +++ b/conf/format.yaml @@ -0,0 +1,8 @@ + +language: de +ligratures: true +hyphenate: true +paragraph-spacing: 1.5 # relative to line height +line-spacing: 0.75 # relative to line height +first-line-indent: 1 # in centimetres +font-size: 12 # in point diff --git a/conf/glossary.yaml b/conf/glossary.yaml new file mode 100644 index 0000000..b188fde --- /dev/null +++ b/conf/glossary.yaml @@ -0,0 +1,9 @@ + +glossary: + +# Example: + +# - short: PLC +# long: Programmable Logic Controller +# desc: Industrial computer for controlling automation devices + diff --git a/src/info.yaml b/info.yaml similarity index 100% rename from src/info.yaml rename to info.yaml diff --git a/res/font/FiraCode/FiraCode Nerd Font Regular.ttf b/res/font/FiraCode/FiraCode Nerd Font Regular.ttf new file mode 100644 index 0000000..7abb9fc Binary files /dev/null and b/res/font/FiraCode/FiraCode Nerd Font Regular.ttf differ diff --git a/res/font/Times New Roman/Times New Roman Bold-Italic.ttf b/res/font/Times New Roman/Times New Roman Bold-Italic.ttf new file mode 100644 index 0000000..c0b27d2 Binary files /dev/null and b/res/font/Times New Roman/Times New Roman Bold-Italic.ttf differ diff --git a/res/font/Times New Roman/Times New Roman Bold.ttf b/res/font/Times New Roman/Times New Roman Bold.ttf new file mode 100644 index 0000000..43259eb Binary files /dev/null and b/res/font/Times New Roman/Times New Roman Bold.ttf differ diff --git a/res/font/Times New Roman/Times New Roman Italic.ttf b/res/font/Times New Roman/Times New Roman Italic.ttf new file mode 100644 index 0000000..4bcad69 Binary files /dev/null and b/res/font/Times New Roman/Times New Roman Italic.ttf differ diff --git a/res/font/Times New Roman/Times New Roman Regular.ttf b/res/font/Times New Roman/Times New Roman Regular.ttf new file mode 100644 index 0000000..f71d84a Binary files /dev/null and b/res/font/Times New Roman/Times New Roman Regular.ttf differ diff --git a/src/extra/util.typ b/src/extra/util.typ new file mode 100644 index 0000000..84a0dc7 --- /dev/null +++ b/src/extra/util.typ @@ -0,0 +1,47 @@ + +#let TitleSize = 24pt +#let SubtitleSize = 18pt +#let LargetextSize = 14pt + +// titles are bold and twice the size of normal text +// also they are centered and not justified +#let title(x) = { + align(center, par(justify: false, text(weight: "regular", size: TitleSize)[#x])) +} + +// subtitles are 1.5x the size of normal text +// also they are centered and not justified +#let subtitle(x) = { + par(justify: false, text(size: SubtitleSize)[#x]) +} + +#let largetext(x) = { + par(justify: false, text(size: LargetextSize)[#x]) +} + +#let signature = { + set align(bottom) + + 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, "Ort, Datum"), + align(left, "Unterschrift") + ) +} + +#let to_em(x) = { + x * 1em +} + +#let to_cm(x) = { + x * 1cm +} + +#let to_pt(x) = { + x * 1pt +} \ No newline at end of file diff --git a/src/main.typ b/src/main.typ index be8378c..7ce4768 100644 --- a/src/main.typ +++ b/src/main.typ @@ -1,73 +1,190 @@ -// style text -#set text( - ligatures: true, - size: 12pt // global font size -) +#import "prelude.typ" as prelude -// page geometry +// set page geometry: +// paper format of A4 #set page( - margin: (left: 3cm, right: 2cm, top: 2cm + 2em + 2em, bottom: 2cm), + margin: (left: 3cm, right: 2cm, top: 2cm + 2em, bottom: 2cm), paper: "a4", ) -#let info = yaml("info.yaml") +// set global text parameter +#set text( + font: "Times New Roman", + size: prelude.to_pt(prelude.format.font-size), + ligatures: prelude.format.ligratures, + hyphenate: prelude.format.hyphenate, + alternates: prelude.format.ligratures, + discretionary-ligatures: prelude.format.ligratures, + lang: prelude.format.language +) + +// set the text properties of verbatim/raw text blocks +#show raw: set text( + font: "FiraCode Nerd Font", + size: prelude.to_pt(prelude.format.font-size), + ligatures: prelude.format.ligratures, + hyphenate: prelude.format.hyphenate, + alternates: prelude.format.ligratures, + discretionary-ligatures: prelude.format.ligratures, + lang: prelude.format.language +) + +// use block element as paragraph +// set block settings for every paragraph +#show par: set block( + below: prelude.to_em(prelude.format.paragraph-spacing), // paragraph spacing +) + +// set global paragraph settings +#set par( + leading: prelude.to_em(prelude.format.line-spacing), + justify: true, + first-line-indent: prelude.to_cm(prelude.format.first-line-indent) +) // set PDF meta information #set document( - author: info.autor, + author: prelude.info.autor, date: datetime.today(), - keywords: info.stichwörter + keywords: prelude.info.stichwörter ) +#set heading(numbering: none) +#set page(numbering: "I.", footer: "") + +#show heading.where( + level: 1 +): it => block(width: 100%)[ + #set align(center) + #set text(prelude.to_pt(prelude.format.font-size) * 2, weight: "regular") + #it.body + #v(0.5cm) +] + #include "pages/titel.typ" #include "pages/selbständigkeitserklärung.typ" #include "pages/sperrvermerk.typ" -#include "pages/gender-hinweis.typ" -#include "pages/übersicht-arbeitspakete.typ" #set page( binding: left, - header-ascent: 2em, + header-ascent: 1em, header: locate(loc => { + smallcaps(prelude.info.titel) + v(-2em) align(right, counter(page).display("I.")) - v(-0.75em) + v(-1em) line(length: 100%) }), footer: "" ) -// vorwort +#show heading.where( + level: 1 +): it => block(width: 100%)[ + #set align(left) + #set text(prelude.to_pt(prelude.format.font-size) * 2, weight: "regular") + #v(0.25cm) + #it.body + #v(0.5cm) +] -#outline(title: "Inhaltsverzeichnis") +#include "pages/gender-hinweis.typ" +#include "pages/übersicht-arbeitspakete.typ" + +#outline(title: "Inhaltsverzeichnis", indent: auto) #pagebreak() #outline( - title: [Abbildungsverzeichnis], + title: "Abbildungsverzeichnis", target: figure.where(kind: image), ) #pagebreak() #outline( - title: [Tabellensverzeichnis], + title: "Tabellensverzeichnis", target: figure.where(kind: table), ) #pagebreak() #outline( - title: [Quelltextverzeichnis], + title: "Quelltextverzeichnis", target: figure.where(kind: raw), ) #pagebreak() +// for creating glossary +#import "@preview/glossarium:0.2.6": make-glossary, print-glossary, gls, glspl +#show: make-glossary + += Glossar + +// read all entries from config file +#let glossary = yaml("../conf/glossary.yaml") +// destination array +#let glossary_entries = () + +// parse TOML entries into correct format +#if glossary.glossary != none { + for entry in glossary.glossary { + let short = entry.at("short", default: none) + let long = entry.at("long", default: none) + let desc = entry.at("desc", default: none) + + if short == none { + panic("Key of glossary term must be specified") + } + + glossary_entries.push((key: short, short: short, long: long, desc: desc)) + } +} + +#print-glossary(glossary_entries) + +#pagebreak() + +// reset page counter +#counter(page).update(0) + += Abteilung + +#show heading.where( + level: 1 +): it => block(width: 100%)[ + #set align(left) + #set text(prelude.to_pt(prelude.format.font-size) * 2, weight: "regular") + #v(0.25cm) + #it.numbering + #it.body + #v(0.5cm) +] + +#set heading(numbering: "1.") #set page( + binding: left, + header-ascent: 1em, header: locate(loc => { align(right, counter(page).display("1.")) + v(-1em) line(length: 100%) }), footer: "" ) + +#set page(numbering: "1.") + += Kapitel +#lorem(100) + +#pagebreak() + +#set heading(numbering: none) + +#bibliography( + style: "ieee", + "../conf/bibliography.bib" +) \ No newline at end of file diff --git a/src/pages/gender-hinweis.typ b/src/pages/gender-hinweis.typ index 8592683..6d0f956 100644 --- a/src/pages/gender-hinweis.typ +++ b/src/pages/gender-hinweis.typ @@ -1,21 +1,13 @@ -// load general information from YAML -#let info = yaml("../info.yaml") - -#v(8em) +#import "../prelude.typ" as prelude // title -#text(size: 2em, weight: "semibold", align(center, "Gender-Hinweis")) += Gender-Hinweis -#v(3em) - -#set par(justify: true) - -#text(size: 1.25em)[ - Zur besseren Lesbarkeit wird in dieser Hausarbeit das gene- - rische Maskulinum verwendet. Die in dieser Arbeit verwendeten - Personenbezeichnungen beziehen sich - sofern nicht anders kennt- - lich gemacht - auf alle Geschlechter. +#prelude.largetext()[ + Zur besseren Lesbarkeit wird in dieser Arbeit das generische Maskulinum verwendet. + Die in dieser Arbeit verwendeten + Personenbezeichnungen beziehen sich - sofern nicht anders kenntlich gemacht - auf alle Geschlechter. ] #pagebreak() diff --git a/src/pages/selbständigkeitserklärung.typ b/src/pages/selbständigkeitserklärung.typ index fac60d0..fc57f5f 100644 --- a/src/pages/selbständigkeitserklärung.typ +++ b/src/pages/selbständigkeitserklärung.typ @@ -1,46 +1,29 @@ - -// load general information from YAML -#let info = yaml("../info.yaml") +#import "../prelude.typ" as prelude #set align(center) // title -#pad(top: 7em, text(size: 2em, weight: "semibold", "Selbständigkeitserklärung")) += Selbständigkeitserklärung -#pad(top: 7em, text(size: 1.25em)[ +#v(1cm) +#prelude.largetext()[ Ich versichere hiermit, dass ich meine #linebreak() Prüfung mit dem Thema -]) +] -#pad( - top: 4em, - { - text(size: 1.5em, weight: "semibold", info.titel) - linebreak() - text(size: 1.5em, info.untertitel) - } -) +#v(1cm) +#prelude.title(prelude.info.titel) -#pad(top: 6em, text(size: 1.5em)[ +// subtitle +#prelude.subtitle(prelude.info.untertitel) + +#v(1cm) +#prelude.largetext()[ 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. -]) +] -#set align(bottom) - -#pad( - top: 3em, - 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: 16em)}), - align(left, {line(length: 16em)}), - align(left, "Ort, Datum"), - align(left, "Unterschrift") - ) -) +#prelude.signature #pagebreak() \ No newline at end of file diff --git a/src/pages/sperrvermerk.typ b/src/pages/sperrvermerk.typ index 2d80509..d77086b 100644 --- a/src/pages/sperrvermerk.typ +++ b/src/pages/sperrvermerk.typ @@ -1,34 +1,17 @@ - -// load general information from YAML -#let info = yaml("../info.yaml") - -#box(height: 7em) +#import "../prelude.typ" as prelude // title -#text(size: 2em, weight: "semibold", align(center, "Sperrvermerk")) += Sperrvermerk -#box(height: 2em) +#v(1cm) -#set par(justify: true) - -#text(size: 1.25em)[ +#prelude.largetext()[ Der Inhalt dieser Arbeit darf weder als Ganzes noch in Auszügen Personen außerhalb des Prüfungsprozesses und des Evaluationsverfahrens zugänglich gemacht werden, sofern keine anders lautende Genehmigung der Ausbildungsstätte vorliegt. ] -#box(height: 7em) - -#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: 16em)}), - align(left, {line(length: 16em)}), - align(left, "Ort, Datum"), - align(left, "Unterschrift") -) +#prelude.signature #pagebreak() diff --git a/src/pages/titel.typ b/src/pages/titel.typ index bc2bd03..cb0f4e2 100644 --- a/src/pages/titel.typ +++ b/src/pages/titel.typ @@ -1,49 +1,46 @@ +#import "../prelude.typ" as prelude -// load general information from YAML -#let info = yaml("../info.yaml") +#let LogoHeight = 1.5cm #set align(center) // logo of ABB and DHBW -#pad( - top: 3em, - grid( - // set width of columns - // 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: 35pt)), - // right align logo of DHBW - align(right, image("../../res/svg/DHBW.svg", height: 40pt)) - ) +#grid( + // set width of columns + // 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)), + // right align logo of DHBW + align(right, image("../../res/svg/DHBW.svg", height: LogoHeight)) ) // title -#pad(top: 4em, text(size: 2em, weight: "semibold", info.titel)) +#v(2cm) +#prelude.title(prelude.info.titel) // subtitle -#pad(top: 1em, text(size: 1.5em, info.untertitel)) +#prelude.subtitle(prelude.info.untertitel) -// subtitle -#pad(top: 4em, text(size: 1.5em, weight: "bold", info.typ)) +// type of paper +#v(1cm) +#prelude.largetext(prelude.info.typ) // number of semester -#pad(top: 2em)[ - Praxisphase des #info.semester Studienjahrs -] +Praxisphase des #prelude.info.semester Studienjahrs // fakulty -#pad(top: 0.5em)[ - an der Fakultät für #info.fakultät +#pad(top: 0.5cm)[ + an der Fakultät für #prelude.info.fakultät #linebreak() - im Studiengang #info.studiengang + im Studiengang #prelude.info.studiengang ] // university -#pad(top: 1.5em)[ +#pad(top: 0.5cm)[ an der #linebreak() - #info.universität + #prelude.info.universität ] #set align(bottom + left) @@ -54,32 +51,32 @@ stroke: none, "Verfasser:", - info.autor, + prelude.info.autor, "Bearbeitungszeitraum:", - info.bearbeitungszeitraum, + prelude.info.bearbeitungszeitraum, "Matrikelnummer, Kurs:", - str(info.matrikelnummer) + ", " + info.studiengang, + str(prelude.info.matrikelnummer) + ", " + prelude.info.studiengang, "Ausbildungsbetrieb:", - info.betrieb, + prelude.info.betrieb, - "Betr. Betreuer:", - info.betreuer, + "Betrieblicher Betreuer:", + prelude.info.betreuer, "Abgabedatum:", - info.abgabe + prelude.info.abgabe ) #pad( - top: 3em, + top: 1cm, grid( // set width of columns // we need two, so make both half the page width columns: (50%, 50%), align(left, "Unterschrift des betrieblichen Betreuers"), - align(right, {line(length: 16em)}) + align(right, {line(length: 6cm)}) ) ) diff --git a/src/pages/übersicht-arbeitspakete.typ b/src/pages/übersicht-arbeitspakete.typ index b6aab43..37a00b7 100644 --- a/src/pages/übersicht-arbeitspakete.typ +++ b/src/pages/übersicht-arbeitspakete.typ @@ -1,22 +1,19 @@ - -#box(height: 7em) +#import "../prelude.typ" as prelude // title -#text(size: 2em, weight: "semibold", align(center, "Übersicht Arbeitspakete")) += Übersicht Arbeitspakete -#box(height: 5em) - -#let info = yaml("../info.yaml") +Folgende Tabelle zeigt die Aktivtäten welche im Zeitraum vom #prelude.info.bearbeitungszeitraum abgehandelt wurden. #figure( kind: table, caption: "Übersicht Arbeitspakete", table( - columns: 3, - align: right, - inset: 1em, + columns: (1fr, auto, auto), + align: center, + inset: 0.25cm, [*Thema*], [*Zeitraum*], [*Dauer (Wochen)*], - ..for packet in info.arbeits-pakete { + ..for packet in prelude.info.arbeits-pakete { let start_split = packet.start.split(".") let start = datetime(day: int(start_split.at(0)), month: int(start_split.at(1)), year: int(start_split.at(2))) diff --git a/src/prelude.typ b/src/prelude.typ new file mode 100644 index 0000000..42b1ff7 --- /dev/null +++ b/src/prelude.typ @@ -0,0 +1,9 @@ + +// import extras +#import "extra/util.typ": title, subtitle, largetext, signature, to_cm, to_pt, to_em + +// import document information +#let info = yaml("../info.yaml") + +// general document information +#let format = yaml("../conf/format.yaml") \ No newline at end of file