Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unofficial-hka-thesis:1.0.0 #1493

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
refactor: kebab-case & latest glossarium version
  • Loading branch information
AnsgarLichter committed Jan 8, 2025
commit 7e0f0da7bc36ba8764003241ea6d3afaf913aa7a
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
114 changes: 114 additions & 0 deletions packages/preview/unofficial-hka-thesis/1.0.0/assets/company.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
78 changes: 39 additions & 39 deletions packages/preview/unofficial-hka-thesis/1.0.0/lib.typ
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
// Page Setup
set page(
margin: (
left: settings.pageMargins.left,
right: settings.pageMargins.right,
top: settings.pageMargins.top,
bottom: settings.pageMargins.bottom
left: settings.page-margins.left,
right: settings.page-margins.right,
top: settings.page-margins.top,
bottom: settings.page-margins.bottom
),
numbering: "I",
number-align: center
Expand All @@ -24,30 +24,30 @@

// Body Font Family
set text(
font: settings.fontBody,
size: settings.fontBodySize,
font: settings.font-body,
size: settings.font-body-size,
lang: "en"
)

show math.equation: set text(weight: 400)

// Headings
show heading: set block(
below: settings.headingsSpacing.below,
above: settings.headingsSpacing.above
below: settings.headings-spacing.below,
above: settings.headings-spacing.above
)
show heading: set text(font: settings.fontBody, size: settings.fontHeadingSize)
show heading: set text(font: settings.font-body, size: settings.font-heading-size)
set heading(numbering: none)

// Paragraphs
set par(leading: settings.distanceBetweenLines, justify: true)
set par(leading: settings.distance-between-lines, justify: true)

// Figures
show figure: set text(size: settings.fontFiguresSubtitleSize)
show figure: set text(size: settings.font-figures-subtitle-size)

//Indentation of Lists
set list(indent: settings.listIndentation)
set enum(indent: settings.listIndentation)
set list(indent: settings.list-indentation)
set enum(indent: settings.list-indentation)
}

#let listings(
Expand Down Expand Up @@ -120,7 +120,7 @@
body
) = {
// Main Body
set heading(numbering: settings.headingsNumberingStyle, supplement: [Chapter])
set heading(numbering: settings.headings-numbering-style, supplement: [Chapter])
show heading.where(level: 1): it => {
if it.numbering == none {
[
Expand All @@ -139,9 +139,9 @@
}

set figure(numbering: it => {
let numberingOfHeading = counter(heading).display();
let topLevelNumber = numberingOfHeading.slice(0, numberingOfHeading.position("."))
[#topLevelNumber.#it]
let numbering-of-heading = counter(heading).display();
let top-level-number = numbering-of-heading.slice(0, numbering-of-heading.position("."))
[#top-level-number.#it]
})

set page(
Expand All @@ -156,19 +156,19 @@
return;
}

let displayHeading
let displayNumbering
let display-heading
let display-numbering
let element
elements = query(selector(heading).after(here()))
if elements != () and elements.first().location().page() == here().page() {
element = elements.first()
if element.has("numbering") and element.numbering != none {
displayNumbering = numbering(element.numbering, ..counter(heading).at(element.location()))
display-numbering = numbering(element.numbering, ..counter(heading).at(element.location()))
} else {
displayNumbering = numbering(settings.headingsNumberingStyle, ..counter(heading).at(element.location()))
display-numbering = numbering(settings.headings-numbering-style, ..counter(heading).at(element.location()))
}

displayHeading = element.body
display-heading = element.body
} else {
// Otherwise take the next heading backwards
elements = query(
Expand All @@ -177,26 +177,26 @@
if elements != () {
element = elements.last()
if element.has("numbering") and element.numbering != none {
displayNumbering = numbering(element.numbering, ..counter(heading).at(element.location()))
display-numbering = numbering(element.numbering, ..counter(heading).at(element.location()))
} else {
displayNumbering = numbering(settings.headingsNumberingStyle, ..counter(heading).at(element.location()))
display-numbering = numbering(settings.headings-numbering-style, ..counter(heading).at(element.location()))
}

displayHeading = element.body
display-heading = element.body
}
}

align(center, displayNumbering + " " + displayHeading)
align(center, display-numbering + " " + display-heading)
line(length: 100%, stroke: (paint: gray))
},

// Footer with Page Numbering
footer: context {
let currentPage = counter(page).display()
let finalPage = counter(page).final().first()
let current-page = counter(page).display()
let final-page = counter(page).final().first()

line(length: 100%, stroke: (paint: gray))
align(center)[#currentPage / #finalPage]
align(center)[#current-page / #final-page]
}
)

Expand All @@ -206,7 +206,7 @@
)
counter(page).update(1)
// Set after header and after all initial pages to just apply it to the acutal content
set par(spacing: settings.spaceBeforeParagraph)
set par(spacing: settings.space-before-paragraph)

// Actual Content
body
Expand All @@ -227,32 +227,32 @@
counter(heading).update(0)
set heading(numbering: "A.1.", supplement: [Appendix])
show heading: it => {
let prefixedNumbering;
let prefixed-numbering;
if it.level == 1 and it.numbering != none {
prefixedNumbering = [#it.supplement #counter(heading).display()]
prefixed-numbering = [#it.supplement #counter(heading).display()]
} else if it.numbering != none {
prefixedNumbering = [#counter(heading).display()]
prefixed-numbering = [#counter(heading).display()]
}

block(
below: 0.85em,
above: 1.75em
)[
#prefixedNumbering #it.body
#prefixed-numbering #it.body
]
}

set figure(numbering: it => {
let alphabet = ("A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z")
let numberingOfHeading = counter(heading).display();
let topLevelNumber = numberingOfHeading.slice(0, numberingOfHeading.position("."))
let index = alphabet.position((el) => { el == topLevelNumber})
let numbering-of-heading = counter(heading).display();
let top-level-number = numbering-of-heading.slice(0, numbering-of-heading.position("."))
let index = alphabet.position((el) => { el == top-level-number})

if index == none {
let numberingToAlphabet = numbering("A", int(topLevelNumber))
let numberingToAlphabet = numbering("A", int(top-level-number))
[#numberingToAlphabet.#it]
} else {
[#topLevelNumber.#it]
[#top-level-number.#it]
}
})

Expand Down
36 changes: 18 additions & 18 deletions packages/preview/unofficial-hka-thesis/1.0.0/modules/titlepage.typ
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
)

set text(
font: settings.fontBody,
size: settings.fontBodySize,
font: settings.font-body,
size: settings.font-body-size,
lang: "en"
)

Expand All @@ -22,15 +22,15 @@
program: "",
title: "",
subtitle: "",
titleGerman: "",
subtitleGerman: "",
title-german: "",
subtitle-german: "",
author: "",
matriculationNumber: "",
placeOfWork: "",
matriculation-number: "",
place-of-work: "",
supervisor: "",
advisor: "",
startDate: none,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

submissionDate: none,
submission-date: none,
) = {

v(5mm)
Expand All @@ -41,17 +41,17 @@
align(center, text(font: settings.fontHeading, 1.5em, weight: 100, degree + "’s Thesis in " + program))
v(8mm)

if titleGerman.len() > 0 {
if subtitle.len() > 0 or subtitleGerman.len() > 0 {
if title-german.len() > 0 {
if subtitle.len() > 0 or subtitle-german.len() > 0 {
align(center, text(font: settings.fontHeading, 1.2em, weight: 700, title))
align(center, text(font: settings.fontHeading, 1.2em, weight: 500, subtitle))
v(10mm)
align(center, text(font: settings.fontHeading, 1.2em, weight: 700, titleGerman))
align(center, text(font: settings.fontHeading, 1.2em, weight: 500, subtitleGerman))
align(center, text(font: settings.fontHeading, 1.2em, weight: 700, title-german))
align(center, text(font: settings.fontHeading, 1.2em, weight: 500, subtitle-german))
} else {
align(center, text(font: settings.fontHeading, 1.4em, weight: 700, title))
v(10mm)
align(center, text(font: settings.fontHeading, 1.4em, weight: 700, titleGerman))
align(center, text(font: settings.fontHeading, 1.4em, weight: 700, title-german))
}
} else {
if subtitle.len() > 0 {
Expand All @@ -73,12 +73,12 @@
columns: (3fr, 3fr),
gutter: 1em,
strong("Author: "), author,
strong("Matriculation Number: "), matriculationNumber,
strong("Place of Work: "), placeOfWork,
strong("Matriculation Number: "), matriculation-number,
strong("Place of Work: "), place-of-work,
strong("Supervisor: "), supervisor,
strong("Advisor: "), advisor,
strong("Start Date: "), startDate,
strong("Submission Date: "), submissionDate,
strong("Submission Date: "), submission-date,
)
)
} else {
Expand All @@ -90,11 +90,11 @@
columns: (3fr, 3fr),
gutter: 1em,
strong("Author: "), author,
strong("Matriculation Number: "), matriculationNumber,
strong("Place of Work: "), placeOfWork,
strong("Matriculation Number: "), matriculation-number,
strong("Place of Work: "), place-of-work,
strong("Supervisor: "), supervisor,
strong("Start Date: "), startDate,
strong("Submission Date: "), submissionDate,
strong("Submission Date: "), submission-date,
)
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

#import "@preview/unofficial-hka-thesis:1.0.0": todo, flex-caption
#import "@preview/glossarium:0.2.6": gls, glspl
#import "@preview/glossarium:0.5.1": gls, glspl

= Introduction

Expand Down
Loading
Loading