diff --git a/src/content/audition.typ b/src/content/audition.typ new file mode 100644 index 0000000..000f270 --- /dev/null +++ b/src/content/audition.typ @@ -0,0 +1,46 @@ + +// ==================================================== +// +// AUDITION OF WORK +// +// Author: Sven Vogel +// License: MIT +// Edited: 29.03.2024 +// +// This file binds and styles pages about: +// - title +// - declaration of indipendence +// - confidential clause +// - gender note +// - working packages +// - abstract +// ==================================================== + +#import "../prelude.typ" as prelude + +#set heading(numbering: none) +#set page(numbering: "I.", footer: "") + +#include "../pages/title.typ" +#include "../pages/declaration-of-indipendence.typ" +#include "../pages/confidential-clause.typ" + +#set page( + binding: left, + header-ascent: 2em, + header: locate(loc => { + table(columns: (1fr, auto), + align: (left, right), + stroke: none, + inset: (top: 0pt, bottom: 0.5em, left: 0pt, right: 0pt), + text(size: prelude.to_pt(prelude.format.font-size), prelude.info.titel), + text(size: prelude.to_pt(prelude.format.font-size), counter(page).display("I.")), + table.hline() + ) + }), + footer: "" +) + +#include "../pages/gender-note.typ" +#include "../pages/working-packages.typ" +#include "../pages/abstract.typ" \ No newline at end of file diff --git a/src/content/bibliography.typ b/src/content/bibliography.typ new file mode 100644 index 0000000..03f99e1 --- /dev/null +++ b/src/content/bibliography.typ @@ -0,0 +1,39 @@ + +// ==================================================== +// +// BIBLIOGRAPHY +// +// Author: Sven Vogel +// License: MIT +// Edited: 29.03.2024 +// +// This file binds and styles bibliography of this work +// ==================================================== + +#import "../prelude.typ" as prelude + +#set heading(numbering: none) + +// function for filtering out all heading which are not of level 1 +#let filter_heading(heading) = { + heading.level == 1 +} + +#set page( + header: locate(loc => { + align(left, context [ + #let current_heading = query(selector(heading).after(here())).filter(filter_heading).first() + #current_heading.body + ]) + v(-2em) + align(right, counter(page).display("1")) + v(-1em) + line(length: 100%) + }), +) + +// load bibliography and add it to the document +#bibliography( + style: "ieee", + "../../conf/bibliography.bib" +) \ No newline at end of file diff --git a/src/content/outline.typ b/src/content/outline.typ new file mode 100644 index 0000000..0890efc --- /dev/null +++ b/src/content/outline.typ @@ -0,0 +1,116 @@ + +// ==================================================== +// +// OUTLINE +// +// Author: Sven Vogel +// License: MIT +// Edited: 29.03.2024 +// +// This file binds and styles the outline of this document +// ==================================================== + +#import "../prelude.typ" as prelude + +#set page( + binding: left, + header-ascent: 2em, + header: locate(loc => { + table(columns: (1fr, auto), + align: (left, right), + stroke: none, + inset: (top: 0pt, bottom: 0.5em, left: 0pt, right: 0pt), + text(size: prelude.to_pt(prelude.format.font-size), prelude.info.titel), + text(size: prelude.to_pt(prelude.format.font-size), counter(page).display("I.")), + table.hline() + ) + }), + footer: "" +) + +#let heading_outline_title = if prelude.format.language == "de" [ + Inhaltsverzeichnis +] else if prelude.format.language == "en" [ + Table of contents +] else [ + #panic("no translation for language: ", prelude.format.language) +] +#outline(title: heading_outline_title, indent: auto) + +#pagebreak() + +#let image_outline_title = if prelude.format.language == "de" [ + Abbildungsverzeichnis +] else if prelude.format.language == "en" [ + List of figures +] else [ + #panic("no translation for language: ", prelude.format.language) +] +#outline( + title: image_outline_title, + target: figure.where(kind: image), +) + +#pagebreak() + +#let table_outline_title = if prelude.format.language == "de" [ + Tabellensverzeichnis +] else if prelude.format.language == "en" [ + List of tables +] else [ + #panic("no translation for language: ", prelude.format.language) +] +#outline( + title: table_outline_title, + target: figure.where(kind: table), +) + +#pagebreak() + +#let raw_outline_title = if prelude.format.language == "de" [ + Quelltextverzeichnis +] else if prelude.format.language == "en" [ + Table of source code +] else [ + #panic("no translation for language: ", prelude.format.language) +] +#outline( + title: raw_outline_title, + target: figure.where(kind: raw), +) + +#pagebreak() + +// for creating glossary +#import "@preview/glossarium:0.2.6": make-glossary, print-glossary, gls, glspl +#show: make-glossary + +#if prelude.format.language == "de" [ + = Glossar +] else if prelude.format.language == "en" [ + = Glossary +] else [ + #panic("no translation for language: ", prelude.format.language) +] + +// 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) diff --git a/src/content/preface.typ b/src/content/preface.typ new file mode 100644 index 0000000..b4b3f5c --- /dev/null +++ b/src/content/preface.typ @@ -0,0 +1,31 @@ + +// ==================================================== +// +// PREFACE +// +// Author: Sven Vogel +// License: MIT +// Edited: 29.03.2024 +// +// This file binds and styles the preface of this document +// ==================================================== + +#import "../prelude.typ" as prelude + +#set page( + binding: left, + header-ascent: 2em, + header: locate(loc => { + table(columns: (1fr, auto), + align: (left, right), + stroke: none, + inset: (top: 0pt, bottom: 0.5em, left: 0pt, right: 0pt), + text(size: prelude.to_pt(prelude.format.font-size), prelude.info.titel), + text(size: prelude.to_pt(prelude.format.font-size), counter(page).display("I.")), + table.hline() + ) + }), + footer: "" +) + +#include "../pages/preface.typ" diff --git a/src/main.typ b/src/main.typ index f64d90e..220a819 100644 --- a/src/main.typ +++ b/src/main.typ @@ -1,13 +1,29 @@ #import "prelude.typ" as prelude +// ------------------------------------------ +// Set page geometry and PDF meta data +// ------------------------------------------ + // set page geometry: // paper format of A4 +// top margin is 2cm (blank space) + 2em (header) + 1em (spacing) #set page( - margin: (left: 3cm, right: 2cm, top: 2cm + 2em, bottom: 2cm), + margin: (left: 3cm, right: 2cm, top: 2cm + 3em, bottom: 2cm), paper: "a4", ) +// set PDF meta information +#set document( + author: prelude.info.autor, + date: datetime.today(), + keywords: prelude.info.stichwörter +) + +// ------------------------------------------ +// Configure fonts and headings +// ------------------------------------------ + // set global text parameter #set text( font: prelude.format.font-familty, @@ -38,8 +54,7 @@ alternates: prelude.format.ligratures, discretionary-ligatures: prelude.format.ligratures, lang: prelude.format.language, - weight: "regular", - baseline: 1em + weight: "regular" ) #show heading.where(level: 2): set text( @@ -64,6 +79,10 @@ weight: "regular" ) +// ------------------------------------------ +// Setup paragraphs +// ------------------------------------------ + // use block element as paragraph // set block settings for every paragraph #show par: set block( @@ -77,191 +96,48 @@ first-line-indent: prelude.to_cm(prelude.format.first-line-indent) ) -// set PDF meta information -#set document( - author: prelude.info.autor, - date: datetime.today(), - keywords: prelude.info.stichwörter -) +// ------------------------------------------ +// Start of content +// ------------------------------------------ -#set heading(numbering: none) -#set page(numbering: "I.", footer: "") - -#include "pages/title.typ" -#include "pages/declaration-of-indipendence.typ" -#include "pages/confidential-clause.typ" - -#set page( - binding: left, - header-ascent: 1em, - header: locate(loc => { - text(size: 12pt)[ - #prelude.info.titel - #v(-2em) - #align(right, counter(page).display("I.")) - #v(-1em) - #line(length: 100%) - ] - }), - footer: "" -) - -#include "pages/gender-note.typ" -#include "pages/working-packages.typ" - -#let heading_outline_title = if prelude.format.language == "de" [ - Inhaltsverzeichnis -] else if prelude.format.language == "en" [ - Table of contents -] else [ - #panic("no translation for language: ", prelude.format.language) -] -#outline(title: heading_outline_title, indent: auto) - -#pagebreak() - -#let image_outline_title = if prelude.format.language == "de" [ - Abbildungsverzeichnis -] else if prelude.format.language == "en" [ - List of figures -] else [ - #panic("no translation for language: ", prelude.format.language) -] -#outline( - title: "Abbildungsverzeichnis", - target: figure.where(kind: image), -) - -#pagebreak() - -#let table_outline_title = if prelude.format.language == "de" [ - Tabellensverzeichnis -] else if prelude.format.language == "en" [ - List of tables -] else [ - #panic("no translation for language: ", prelude.format.language) -] -#outline( - title: table_outline_title, - target: figure.where(kind: table), -) - -#pagebreak() - -#let raw_outline_title = if prelude.format.language == "de" [ - Quelltextverzeichnis -] else if prelude.format.language == "en" [ - Table of source code -] else [ - #panic("no translation for language: ", prelude.format.language) -] -#outline( - title: raw_outline_title, - target: figure.where(kind: raw), -) - -#pagebreak() - -// for creating glossary -#import "@preview/glossarium:0.2.6": make-glossary, print-glossary, gls, glspl -#show: make-glossary - -#if prelude.format.language == "de" [ - = Glossar -] else if prelude.format.language == "en" [ - = Glossary -] else [ - #panic("no translation for language: ", prelude.format.language) -] - -// 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() +#include "content/audition.typ" +#include "content/preface.typ" +#include "content/outline.typ" // reset page counter -#counter(page).update(0) - -= Abteilung +#counter(page).update(1) #set heading(numbering: "1.") +// start numbering pages with numeric digits +#set page(numbering: "1.") + #let filter_heading(heading) = { heading.level == 1 } #set page( binding: left, - header-ascent: 1em, + header-ascent: 2em, header: locate(loc => { - align(left, context [ - #let current_heading = query(selector(heading).after(here())).filter(filter_heading).first() - #let heading_depth = counter(heading).get().at(0) + 1 - - #heading_depth - #h(0.25cm) - #current_heading.body - ]) - v(-2em) - align(right, counter(page).display("1")) - v(-1em) - line(length: 100%) + let current_heading = query(selector(heading).after(here())).filter(filter_heading).first() + let heading_depth = counter(heading).get().at(0) + 1 + table(columns: (1fr, auto), + align: (left, right), + stroke: none, + inset: (top: 0pt, bottom: 0.5em, left: 0pt, right: 0pt), + text(size: prelude.to_pt(prelude.format.font-size))[#heading_depth #current_heading.body], + text(size: prelude.to_pt(prelude.format.font-size), counter(page).display("1")), + table.hline() + ) }), footer: "" ) -#set page(numbering: "1.") +#include "pages/introduction.typ" -= Kapitel +// ------------------------------------------ +// Actual work pages follow here +// ------------------------------------------ -== Überschrift 2 - -#pagebreak() - -#lorem(200) - -= Kapitel 2 - -=== Überschrift 3 - -#lorem(50) - -#pagebreak() - -#set heading(numbering: none) -#set page( - header: locate(loc => { - align(left, context [ - #let current_heading = query(selector(heading).after(here())).filter(filter_heading).first() - #current_heading.body - ]) - v(-2em) - align(right, counter(page).display("1")) - v(-1em) - line(length: 100%) - }), -) - -#bibliography( - style: "ieee", - "../conf/bibliography.bib" -) \ No newline at end of file +#include "content/bibliography.typ" diff --git a/src/pages/declaration-of-indipendence.typ b/src/pages/declaration-of-indipendence.typ index 3d81ef6..76c89ea 100644 --- a/src/pages/declaration-of-indipendence.typ +++ b/src/pages/declaration-of-indipendence.typ @@ -28,7 +28,10 @@ // subtitle #prelude.subtitle(prelude.info.untertitel) +#set align(left) + #v(1cm) + #prelude.largetext()[ #if prelude.format.language == "de" [ selbständig verfasst und keine anderen als die angegebenen Quellen und Hilfsmittel benutzt habe. diff --git a/src/pages/gender-note.typ b/src/pages/gender-note.typ index 83a327d..849b037 100644 --- a/src/pages/gender-note.typ +++ b/src/pages/gender-note.typ @@ -21,5 +21,3 @@ #panic("no translation for language: ", prelude.format.language) ] ] - -#pagebreak() diff --git a/src/pages/introduction.typ b/src/pages/introduction.typ new file mode 100644 index 0000000..324483d --- /dev/null +++ b/src/pages/introduction.typ @@ -0,0 +1,4 @@ + +#import "../prelude.typ" as prelude + += Einleitung diff --git a/src/pages/preface.typ b/src/pages/preface.typ new file mode 100644 index 0000000..52b4d19 --- /dev/null +++ b/src/pages/preface.typ @@ -0,0 +1,10 @@ + +#import "../prelude.typ" as prelude + += Vorwort + += Firmengeschichte + += Das Unternehmen ABB + += Abteilung diff --git a/src/pages/title.typ b/src/pages/title.typ index 2629044..a54f1c7 100644 --- a/src/pages/title.typ +++ b/src/pages/title.typ @@ -68,6 +68,7 @@ #if prelude.format.language == "de" [ #table( columns: 2, + column-gutter: 1cm, align: left, stroke: none, @@ -92,6 +93,7 @@ ] else if prelude.format.language == "en" [ #table( columns: 2, + column-gutter: 1cm, align: left, stroke: none,