refactor: use kebab case
This commit is contained in:
parent
2df43f537b
commit
e6bbc33900
5 changed files with 80 additions and 81 deletions
78
lib.typ
78
lib.typ
|
|
@ -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
|
||||
|
|
@ -24,8 +24,8 @@
|
|||
|
||||
// Body Font Family
|
||||
set text(
|
||||
font: settings.fontBody,
|
||||
size: settings.fontBodySize,
|
||||
font: settings.font-body,
|
||||
size: settings.font-body-size,
|
||||
lang: "en"
|
||||
)
|
||||
|
||||
|
|
@ -33,21 +33,21 @@
|
|||
|
||||
// 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(
|
||||
|
|
@ -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 {
|
||||
[
|
||||
|
|
@ -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(
|
||||
|
|
@ -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(
|
||||
|
|
@ -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]
|
||||
}
|
||||
)
|
||||
|
||||
|
|
@ -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
|
||||
|
|
@ -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]
|
||||
}
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
)
|
||||
|
||||
set text(
|
||||
font: settings.fontBody,
|
||||
size: settings.fontBodySize,
|
||||
font: settings.font-body,
|
||||
size: settings.font-body-size,
|
||||
lang: "en"
|
||||
)
|
||||
|
||||
|
|
@ -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,
|
||||
submissionDate: none,
|
||||
submission-date: none,
|
||||
) = {
|
||||
|
||||
v(5mm)
|
||||
|
|
@ -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 {
|
||||
|
|
@ -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 {
|
||||
|
|
@ -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,
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
#let degree = "Master" //Bachelor or Master
|
||||
#let program = "Computer Science"
|
||||
#let titleEnglish = "Title English"
|
||||
#let subtitleEnglish = "Subtitle English"
|
||||
#let titleGerman = "Title German"
|
||||
#let subtitleGerman = "Subtitle German"
|
||||
#let title-english = "Title English"
|
||||
#let subtitle-english = "Subtitle English"
|
||||
#let title-german = "Title German"
|
||||
#let subtitle-german = "Subtitle German"
|
||||
#let author = "Max Mustermann"
|
||||
#let matriculationNumber = "12345"
|
||||
#let placeOfWork = "ABC"
|
||||
#let matriculation-number = "12345"
|
||||
#let place-of-work = "ABC"
|
||||
#let supervisor = "Prof Dr. Max Mustermann"
|
||||
#let advisor = "Prof Dr. John Doe"
|
||||
#let startDate = "01.03.2024"
|
||||
#let submissionDate = "31.08.2024"
|
||||
#let submissionDateExposé = "29.02.2024"
|
||||
#let submission-date = "31.08.2024"
|
||||
#let place = "Karlsruhe"
|
||||
|
|
@ -1,20 +1,20 @@
|
|||
#let settings = (
|
||||
fontBody: "New Computer Modern",
|
||||
fontBodySize: 12pt,
|
||||
fontFiguresSubtitleSize: 0.85em,
|
||||
font-body: "New Computer Modern",
|
||||
font-body-size: 12pt,
|
||||
font-figures-subtitle-size: 0.85em,
|
||||
// At the moment only used on the title page
|
||||
fontHeading: "New Computer Modern Sans",
|
||||
fontHeadingSize: 16pt,
|
||||
headingsNumberingStyle: "1.1.",
|
||||
headingsSpacing: (
|
||||
font-heading-size: 16pt,
|
||||
headings-numbering-style: "1.1.",
|
||||
headings-spacing: (
|
||||
below: 0.85em,
|
||||
above: 1.75em
|
||||
),
|
||||
citationStyle: "ieee",
|
||||
spaceBeforeParagraph: 24pt,
|
||||
distanceBetweenLines: 1em,
|
||||
listIndentation: 2.5em,
|
||||
pageMargins: (
|
||||
space-before-paragraph: 24pt,
|
||||
distance-between-lines: 1em,
|
||||
list-indentation: 2.5em,
|
||||
page-margins: (
|
||||
top: 4cm,
|
||||
bottom: 2.5cm,
|
||||
left: 2.5cm,
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
#show: make-glossary
|
||||
|
||||
#set document(title: titleEnglish, author: author)
|
||||
#set document(title: title-english, author: author)
|
||||
#openTitlePage(settings: settings)
|
||||
// Customize your company logo or just use the one from the university
|
||||
#grid(
|
||||
|
|
@ -23,15 +23,15 @@
|
|||
settings: settings,
|
||||
degree: degree,
|
||||
program: program,
|
||||
title: titleEnglish,
|
||||
subtitle: subtitleEnglish,
|
||||
title: title-english,
|
||||
subtitle: subtitle-english,
|
||||
author: author,
|
||||
matriculationNumber: matriculationNumber,
|
||||
placeOfWork: placeOfWork,
|
||||
matriculation-number: matriculation-number,
|
||||
place-of-work: place-of-work,
|
||||
supervisor: supervisor,
|
||||
advisor: advisor,
|
||||
startDate: startDate,
|
||||
submissionDate: submissionDate,
|
||||
submission-date: submission-date,
|
||||
)
|
||||
|
||||
#preface(settings: settings)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue