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
|
// Page Setup
|
||||||
set page(
|
set page(
|
||||||
margin: (
|
margin: (
|
||||||
left: settings.pageMargins.left,
|
left: settings.page-margins.left,
|
||||||
right: settings.pageMargins.right,
|
right: settings.page-margins.right,
|
||||||
top: settings.pageMargins.top,
|
top: settings.page-margins.top,
|
||||||
bottom: settings.pageMargins.bottom
|
bottom: settings.page-margins.bottom
|
||||||
),
|
),
|
||||||
numbering: "I",
|
numbering: "I",
|
||||||
number-align: center
|
number-align: center
|
||||||
|
|
@ -24,8 +24,8 @@
|
||||||
|
|
||||||
// Body Font Family
|
// Body Font Family
|
||||||
set text(
|
set text(
|
||||||
font: settings.fontBody,
|
font: settings.font-body,
|
||||||
size: settings.fontBodySize,
|
size: settings.font-body-size,
|
||||||
lang: "en"
|
lang: "en"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -33,21 +33,21 @@
|
||||||
|
|
||||||
// Headings
|
// Headings
|
||||||
show heading: set block(
|
show heading: set block(
|
||||||
below: settings.headingsSpacing.below,
|
below: settings.headings-spacing.below,
|
||||||
above: settings.headingsSpacing.above
|
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)
|
set heading(numbering: none)
|
||||||
|
|
||||||
// Paragraphs
|
// Paragraphs
|
||||||
set par(leading: settings.distanceBetweenLines, justify: true)
|
set par(leading: settings.distance-between-lines, justify: true)
|
||||||
|
|
||||||
// Figures
|
// Figures
|
||||||
show figure: set text(size: settings.fontFiguresSubtitleSize)
|
show figure: set text(size: settings.font-figures-subtitle-size)
|
||||||
|
|
||||||
//Indentation of Lists
|
//Indentation of Lists
|
||||||
set list(indent: settings.listIndentation)
|
set list(indent: settings.list-indentation)
|
||||||
set enum(indent: settings.listIndentation)
|
set enum(indent: settings.list-indentation)
|
||||||
}
|
}
|
||||||
|
|
||||||
#let listings(
|
#let listings(
|
||||||
|
|
@ -120,7 +120,7 @@
|
||||||
body
|
body
|
||||||
) = {
|
) = {
|
||||||
// Main 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 => {
|
show heading.where(level: 1): it => {
|
||||||
if it.numbering == none {
|
if it.numbering == none {
|
||||||
[
|
[
|
||||||
|
|
@ -139,9 +139,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
set figure(numbering: it => {
|
set figure(numbering: it => {
|
||||||
let numberingOfHeading = counter(heading).display();
|
let numbering-of-heading = counter(heading).display();
|
||||||
let topLevelNumber = numberingOfHeading.slice(0, numberingOfHeading.position("."))
|
let top-level-number = numbering-of-heading.slice(0, numbering-of-heading.position("."))
|
||||||
[#topLevelNumber.#it]
|
[#top-level-number.#it]
|
||||||
})
|
})
|
||||||
|
|
||||||
set page(
|
set page(
|
||||||
|
|
@ -156,19 +156,19 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let displayHeading
|
let display-heading
|
||||||
let displayNumbering
|
let display-numbering
|
||||||
let element
|
let element
|
||||||
elements = query(selector(heading).after(here()))
|
elements = query(selector(heading).after(here()))
|
||||||
if elements != () and elements.first().location().page() == here().page() {
|
if elements != () and elements.first().location().page() == here().page() {
|
||||||
element = elements.first()
|
element = elements.first()
|
||||||
if element.has("numbering") and element.numbering != none {
|
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 {
|
} 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 {
|
} else {
|
||||||
// Otherwise take the next heading backwards
|
// Otherwise take the next heading backwards
|
||||||
elements = query(
|
elements = query(
|
||||||
|
|
@ -177,26 +177,26 @@
|
||||||
if elements != () {
|
if elements != () {
|
||||||
element = elements.last()
|
element = elements.last()
|
||||||
if element.has("numbering") and element.numbering != none {
|
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 {
|
} 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))
|
line(length: 100%, stroke: (paint: gray))
|
||||||
},
|
},
|
||||||
|
|
||||||
// Footer with Page Numbering
|
// Footer with Page Numbering
|
||||||
footer: context {
|
footer: context {
|
||||||
let currentPage = counter(page).display()
|
let current-page = counter(page).display()
|
||||||
let finalPage = counter(page).final().first()
|
let final-page = counter(page).final().first()
|
||||||
|
|
||||||
line(length: 100%, stroke: (paint: gray))
|
line(length: 100%, stroke: (paint: gray))
|
||||||
align(center)[#currentPage / #finalPage]
|
align(center)[#current-page / #final-page]
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -206,7 +206,7 @@
|
||||||
)
|
)
|
||||||
counter(page).update(1)
|
counter(page).update(1)
|
||||||
// Set after header and after all initial pages to just apply it to the acutal content
|
// 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
|
// Actual Content
|
||||||
body
|
body
|
||||||
|
|
@ -227,32 +227,32 @@
|
||||||
counter(heading).update(0)
|
counter(heading).update(0)
|
||||||
set heading(numbering: "A.1.", supplement: [Appendix])
|
set heading(numbering: "A.1.", supplement: [Appendix])
|
||||||
show heading: it => {
|
show heading: it => {
|
||||||
let prefixedNumbering;
|
let prefixed-numbering;
|
||||||
if it.level == 1 and it.numbering != none {
|
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 {
|
} else if it.numbering != none {
|
||||||
prefixedNumbering = [#counter(heading).display()]
|
prefixed-numbering = [#counter(heading).display()]
|
||||||
}
|
}
|
||||||
|
|
||||||
block(
|
block(
|
||||||
below: 0.85em,
|
below: 0.85em,
|
||||||
above: 1.75em
|
above: 1.75em
|
||||||
)[
|
)[
|
||||||
#prefixedNumbering #it.body
|
#prefixed-numbering #it.body
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
set figure(numbering: it => {
|
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 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 numbering-of-heading = counter(heading).display();
|
||||||
let topLevelNumber = numberingOfHeading.slice(0, numberingOfHeading.position("."))
|
let top-level-number = numbering-of-heading.slice(0, numbering-of-heading.position("."))
|
||||||
let index = alphabet.position((el) => { el == topLevelNumber})
|
let index = alphabet.position((el) => { el == top-level-number})
|
||||||
|
|
||||||
if index == none {
|
if index == none {
|
||||||
let numberingToAlphabet = numbering("A", int(topLevelNumber))
|
let numberingToAlphabet = numbering("A", int(top-level-number))
|
||||||
[#numberingToAlphabet.#it]
|
[#numberingToAlphabet.#it]
|
||||||
} else {
|
} else {
|
||||||
[#topLevelNumber.#it]
|
[#top-level-number.#it]
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@
|
||||||
)
|
)
|
||||||
|
|
||||||
set text(
|
set text(
|
||||||
font: settings.fontBody,
|
font: settings.font-body,
|
||||||
size: settings.fontBodySize,
|
size: settings.font-body-size,
|
||||||
lang: "en"
|
lang: "en"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -22,15 +22,15 @@
|
||||||
program: "",
|
program: "",
|
||||||
title: "",
|
title: "",
|
||||||
subtitle: "",
|
subtitle: "",
|
||||||
titleGerman: "",
|
title-german: "",
|
||||||
subtitleGerman: "",
|
subtitle-german: "",
|
||||||
author: "",
|
author: "",
|
||||||
matriculationNumber: "",
|
matriculation-number: "",
|
||||||
placeOfWork: "",
|
place-of-work: "",
|
||||||
supervisor: "",
|
supervisor: "",
|
||||||
advisor: "",
|
advisor: "",
|
||||||
startDate: none,
|
startDate: none,
|
||||||
submissionDate: none,
|
submission-date: none,
|
||||||
) = {
|
) = {
|
||||||
|
|
||||||
v(5mm)
|
v(5mm)
|
||||||
|
|
@ -41,17 +41,17 @@
|
||||||
align(center, text(font: settings.fontHeading, 1.5em, weight: 100, degree + "’s Thesis in " + program))
|
align(center, text(font: settings.fontHeading, 1.5em, weight: 100, degree + "’s Thesis in " + program))
|
||||||
v(8mm)
|
v(8mm)
|
||||||
|
|
||||||
if titleGerman.len() > 0 {
|
if title-german.len() > 0 {
|
||||||
if subtitle.len() > 0 or subtitleGerman.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: 700, title))
|
||||||
align(center, text(font: settings.fontHeading, 1.2em, weight: 500, subtitle))
|
align(center, text(font: settings.fontHeading, 1.2em, weight: 500, subtitle))
|
||||||
v(10mm)
|
v(10mm)
|
||||||
align(center, text(font: settings.fontHeading, 1.2em, weight: 700, titleGerman))
|
align(center, text(font: settings.fontHeading, 1.2em, weight: 700, title-german))
|
||||||
align(center, text(font: settings.fontHeading, 1.2em, weight: 500, subtitleGerman))
|
align(center, text(font: settings.fontHeading, 1.2em, weight: 500, subtitle-german))
|
||||||
} else {
|
} else {
|
||||||
align(center, text(font: settings.fontHeading, 1.4em, weight: 700, title))
|
align(center, text(font: settings.fontHeading, 1.4em, weight: 700, title))
|
||||||
v(10mm)
|
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 {
|
} else {
|
||||||
if subtitle.len() > 0 {
|
if subtitle.len() > 0 {
|
||||||
|
|
@ -73,12 +73,12 @@
|
||||||
columns: (3fr, 3fr),
|
columns: (3fr, 3fr),
|
||||||
gutter: 1em,
|
gutter: 1em,
|
||||||
strong("Author: "), author,
|
strong("Author: "), author,
|
||||||
strong("Matriculation Number: "), matriculationNumber,
|
strong("Matriculation Number: "), matriculation-number,
|
||||||
strong("Place of Work: "), placeOfWork,
|
strong("Place of Work: "), place-of-work,
|
||||||
strong("Supervisor: "), supervisor,
|
strong("Supervisor: "), supervisor,
|
||||||
strong("Advisor: "), advisor,
|
strong("Advisor: "), advisor,
|
||||||
strong("Start Date: "), startDate,
|
strong("Start Date: "), startDate,
|
||||||
strong("Submission Date: "), submissionDate,
|
strong("Submission Date: "), submission-date,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -90,11 +90,11 @@
|
||||||
columns: (3fr, 3fr),
|
columns: (3fr, 3fr),
|
||||||
gutter: 1em,
|
gutter: 1em,
|
||||||
strong("Author: "), author,
|
strong("Author: "), author,
|
||||||
strong("Matriculation Number: "), matriculationNumber,
|
strong("Matriculation Number: "), matriculation-number,
|
||||||
strong("Place of Work: "), placeOfWork,
|
strong("Place of Work: "), place-of-work,
|
||||||
strong("Supervisor: "), supervisor,
|
strong("Supervisor: "), supervisor,
|
||||||
strong("Start Date: "), startDate,
|
strong("Start Date: "), startDate,
|
||||||
strong("Submission Date: "), submissionDate,
|
strong("Submission Date: "), submission-date,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,14 @@
|
||||||
#let degree = "Master" //Bachelor or Master
|
#let degree = "Master" //Bachelor or Master
|
||||||
#let program = "Computer Science"
|
#let program = "Computer Science"
|
||||||
#let titleEnglish = "Title English"
|
#let title-english = "Title English"
|
||||||
#let subtitleEnglish = "Subtitle English"
|
#let subtitle-english = "Subtitle English"
|
||||||
#let titleGerman = "Title German"
|
#let title-german = "Title German"
|
||||||
#let subtitleGerman = "Subtitle German"
|
#let subtitle-german = "Subtitle German"
|
||||||
#let author = "Max Mustermann"
|
#let author = "Max Mustermann"
|
||||||
#let matriculationNumber = "12345"
|
#let matriculation-number = "12345"
|
||||||
#let placeOfWork = "ABC"
|
#let place-of-work = "ABC"
|
||||||
#let supervisor = "Prof Dr. Max Mustermann"
|
#let supervisor = "Prof Dr. Max Mustermann"
|
||||||
#let advisor = "Prof Dr. John Doe"
|
#let advisor = "Prof Dr. John Doe"
|
||||||
#let startDate = "01.03.2024"
|
#let startDate = "01.03.2024"
|
||||||
#let submissionDate = "31.08.2024"
|
#let submission-date = "31.08.2024"
|
||||||
#let submissionDateExposé = "29.02.2024"
|
|
||||||
#let place = "Karlsruhe"
|
#let place = "Karlsruhe"
|
||||||
|
|
@ -1,20 +1,20 @@
|
||||||
#let settings = (
|
#let settings = (
|
||||||
fontBody: "New Computer Modern",
|
font-body: "New Computer Modern",
|
||||||
fontBodySize: 12pt,
|
font-body-size: 12pt,
|
||||||
fontFiguresSubtitleSize: 0.85em,
|
font-figures-subtitle-size: 0.85em,
|
||||||
// At the moment only used on the title page
|
// At the moment only used on the title page
|
||||||
fontHeading: "New Computer Modern Sans",
|
fontHeading: "New Computer Modern Sans",
|
||||||
fontHeadingSize: 16pt,
|
font-heading-size: 16pt,
|
||||||
headingsNumberingStyle: "1.1.",
|
headings-numbering-style: "1.1.",
|
||||||
headingsSpacing: (
|
headings-spacing: (
|
||||||
below: 0.85em,
|
below: 0.85em,
|
||||||
above: 1.75em
|
above: 1.75em
|
||||||
),
|
),
|
||||||
citationStyle: "ieee",
|
citationStyle: "ieee",
|
||||||
spaceBeforeParagraph: 24pt,
|
space-before-paragraph: 24pt,
|
||||||
distanceBetweenLines: 1em,
|
distance-between-lines: 1em,
|
||||||
listIndentation: 2.5em,
|
list-indentation: 2.5em,
|
||||||
pageMargins: (
|
page-margins: (
|
||||||
top: 4cm,
|
top: 4cm,
|
||||||
bottom: 2.5cm,
|
bottom: 2.5cm,
|
||||||
left: 2.5cm,
|
left: 2.5cm,
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#show: make-glossary
|
#show: make-glossary
|
||||||
|
|
||||||
#set document(title: titleEnglish, author: author)
|
#set document(title: title-english, author: author)
|
||||||
#openTitlePage(settings: settings)
|
#openTitlePage(settings: settings)
|
||||||
// Customize your company logo or just use the one from the university
|
// Customize your company logo or just use the one from the university
|
||||||
#grid(
|
#grid(
|
||||||
|
|
@ -23,15 +23,15 @@
|
||||||
settings: settings,
|
settings: settings,
|
||||||
degree: degree,
|
degree: degree,
|
||||||
program: program,
|
program: program,
|
||||||
title: titleEnglish,
|
title: title-english,
|
||||||
subtitle: subtitleEnglish,
|
subtitle: subtitle-english,
|
||||||
author: author,
|
author: author,
|
||||||
matriculationNumber: matriculationNumber,
|
matriculation-number: matriculation-number,
|
||||||
placeOfWork: placeOfWork,
|
place-of-work: place-of-work,
|
||||||
supervisor: supervisor,
|
supervisor: supervisor,
|
||||||
advisor: advisor,
|
advisor: advisor,
|
||||||
startDate: startDate,
|
startDate: startDate,
|
||||||
submissionDate: submissionDate,
|
submission-date: submission-date,
|
||||||
)
|
)
|
||||||
|
|
||||||
#preface(settings: settings)
|
#preface(settings: settings)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue