Skip to content

Commit

Permalink
Streamline font handling across files (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertjndw authored Jan 23, 2025
1 parent 768edbf commit 58fd439
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 63 deletions.
9 changes: 4 additions & 5 deletions layout/abstract.typ
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#import "/layout/fonts.typ": *

#let abstract(body, lang: "en") = {
let title = (en: "Abstract", de: "Zusammenfassung")

Expand All @@ -7,11 +9,8 @@
number-align: center,
)

let body-font = "New Computer Modern"
let sans-font = "New Computer Modern Sans"

set text(
font: body-font,
font: fonts.body,
size: 12pt,
lang: lang
)
Expand All @@ -23,7 +22,7 @@

// --- Abstract ---
v(1fr)
align(center, text(font: body-font, 1em, weight: "semibold", title.at(lang)))
align(center, text(font: fonts.body, 1em, weight: "semibold", title.at(lang)))

body

Expand Down
9 changes: 4 additions & 5 deletions layout/acknowledgement.typ
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
#import "/layout/fonts.typ": *

#let acknowledgement(body) = {
set page(
margin: (left: 30mm, right: 30mm, top: 40mm, bottom: 40mm),
numbering: none,
number-align: center,
)

let body-font = "New Computer Modern"
let sans-font = "New Computer Modern Sans"

set text(
font: body-font,
font: fonts.body,
size: 12pt,
lang: "en"
)
Expand All @@ -20,7 +19,7 @@
)

// --- Acknowledgements ---
align(left, text(font: sans-font, 2em, weight: 700,"Acknowledgements"))
align(left, text(font: fonts.sans, 2em, weight: 700,"Acknowledgements"))
v(15mm)

body
Expand Down
17 changes: 8 additions & 9 deletions layout/cover.typ
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#import "/layout/fonts.typ": *

#let cover(
title: "",
degree: "",
Expand All @@ -10,11 +12,8 @@
number-align: center,
)

let body-font = "New Computer Modern"
let sans-font = "New Computer Modern Sans"

set text(
font: body-font,
font: fonts.body,
size: 12pt,
lang: "en"
)
Expand All @@ -27,19 +26,19 @@
align(center, image("../figures/tum_logo.png", width: 26%))

v(5mm)
align(center, text(font: sans-font, 2em, weight: 700, "Technical University of Munich"))
align(center, text(font: fonts.sans, 2em, weight: 700, "Technical University of Munich"))

v(5mm)
align(center, text(font: sans-font, 1.5em, weight: 100, "School of Computation, Information and Technology \n -- Informatics --"))
align(center, text(font: fonts.sans, 1.5em, weight: 100, "School of Computation, Information and Technology \n -- Informatics --"))

v(15mm)

align(center, text(font: sans-font, 1.3em, weight: 100, degree + "’s Thesis in " + program))
align(center, text(font: fonts.sans, 1.3em, weight: 100, degree + "’s Thesis in " + program))
v(15mm)


align(center, text(font: sans-font, 2em, weight: 700, title))
align(center, text(font: fonts.sans, 2em, weight: 700, title))

v(10mm)
align(center, text(font: sans-font, 2em, weight: 500, author))
align(center, text(font: fonts.sans, 2em, weight: 500, author))
}
7 changes: 3 additions & 4 deletions layout/disclaimer.typ
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#import "/layout/fonts.typ": *

#let disclaimer(
title: "",
degree: "",
Expand All @@ -10,11 +12,8 @@
number-align: center,
)

let body-font = "New Computer Modern"
let sans-font = "New Computer Modern Sans"

set text(
font: body-font,
font: fonts.body,
size: 12pt,
lang: "en"
)
Expand Down
12 changes: 5 additions & 7 deletions layout/feedbacklog_template.typ
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#import "/layout/fonts.typ": *

#let feedbacklog(
titleEnglish: "",
supervisor: "",
Expand All @@ -14,22 +16,18 @@
number-align: center,
)

// Save heading and body font families in variables.
let body-font = "New Computer Modern"
let sans-font = "New Computer Modern Sans"

// Set body font family.
set text(
font: body-font,
font: fonts.body,
size: 12pt,
lang: "en"
)

align(center, text(font: "sans-font", 1.7em, weight: 700, "Presentation Feedbacklog" + linebreak() + titleEnglish))
align(center, text(font: fonts.sans, 1.7em, weight: 700, "Presentation Feedbacklog" + linebreak() + titleEnglish))

v(7.5mm)

align(center, text(font: "sans-font", 1.2em, weight: 400, feedbacklogSubmissionDate.display("[day]. [month repr:long] [year]")))
align(center, text(font: fonts.sans, 1.2em, weight: 400, feedbacklogSubmissionDate.display("[day]. [month repr:long] [year]")))

v(7.5mm)

Expand Down
4 changes: 4 additions & 0 deletions layout/fonts.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#let fonts = (
body: "New Computer Modern",
sans: "New Computer Modern Sans",
)
9 changes: 3 additions & 6 deletions layout/proposal_template.typ
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#import "/layout/titlepage.typ": *
#import "/layout/transparency_ai_tools.typ": transparency_ai_tools as transparency_ai_tools_layout
#import "/utils/print_page_break.typ": *
#import "/layout/fonts.typ": *

// The project function defines how your document looks.
// It takes your content and some metadata and formats it.
Expand Down Expand Up @@ -40,13 +41,9 @@
number-align: center,
)

// Save heading and body font families in variables.
let body-font = "New Computer Modern"
let sans-font = "New Computer Modern Sans"

// Set body font family.
set text(
font: body-font,
font: fonts.body,
size: 12pt,
lang: "en"
)
Expand All @@ -55,7 +52,7 @@

// --- Headings ---
show heading: set block(below: 0.85em, above: 1.75em)
show heading: set text(font: body-font)
show heading: set text(font: fonts.body)
set heading(numbering: "1.1")

// --- Paragraphs ---
Expand Down
11 changes: 4 additions & 7 deletions layout/registration_certificate.typ
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#import "/utils/formfield.typ": *
#import "/layout/fonts.typ": *

#let registrationCertificate(
author: "",
Expand All @@ -18,13 +19,9 @@
margin: (left: 20mm, right: 20mm, top: 20mm, bottom: 20mm),
)

// Save heading and body font families in variables.
let body-font = "New Computer Modern"
let sans-font = "New Computer Modern Sans"

// Set body font family.
set text(
font: body-font,
font: fonts.body,
size: 12pt,
lang: "en"
)
Expand All @@ -35,13 +32,13 @@
dir: ttb,
spacing: 10pt,
image("/figures/tum_logo.png", width: 20%),
text(font: sans-font, weight: "bold", "Technical University \n of Munich")
text(font: fonts.sans, weight: "bold", "Technical University \n of Munich")
)
)

v(1.5cm)

align(left, text(font: sans-font, 1.3em, weight: "bold", "Bestätigung zur Anmeldung der " + degree + "arbeit"))
align(left, text(font: fonts.sans, 1.3em, weight: "bold", "Bestätigung zur Anmeldung der " + degree + "arbeit"))

grid(
columns: 2,
Expand Down
10 changes: 4 additions & 6 deletions layout/thesis_template.typ
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#import "/layout/transparency_ai_tools.typ": transparency_ai_tools as transparency_ai_tools_layout
#import "/layout/abstract.typ": *
#import "/utils/print_page_break.typ": *
#import "/layout/fonts.typ": *

#let thesis(
title: "",
Expand Down Expand Up @@ -69,11 +70,8 @@
number-align: center,
)

let body-font = "New Computer Modern"
let sans-font = "New Computer Modern Sans"

set text(
font: body-font,
font: fonts.body,
size: 12pt,
lang: "en"
)
Expand All @@ -82,7 +80,7 @@

// --- Headings ---
show heading: set block(below: 0.85em, above: 1.75em)
show heading: set text(font: body-font)
show heading: set text(font: fonts.body)
set heading(numbering: "1.1")
// Reference first-level headings as "chapters"
show ref: it => {
Expand Down Expand Up @@ -116,7 +114,7 @@
}
outline(
title: {
text(font: body-font, 1.5em, weight: 700, "Contents")
text(font: fonts.body, 1.5em, weight: 700, "Contents")
v(15mm)
},
indent: 2em
Expand Down
17 changes: 8 additions & 9 deletions layout/titlepage.typ
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#import "/layout/fonts.typ": *

#let titlepage(
title: "",
titleGerman: "",
Expand All @@ -18,11 +20,8 @@
number-align: center,
)

let body-font = "New Computer Modern"
let sans-font = "New Computer Modern Sans"

set text(
font: body-font,
font: fonts.body,
size: 12pt,
lang: "en"
)
Expand All @@ -35,21 +34,21 @@
align(center, image("/figures/tum_logo.png", width: 26%))

v(5mm)
align(center, text(font: sans-font, 2em, weight: 700, "Technical University of Munich"))
align(center, text(font: fonts.sans, 2em, weight: 700, "Technical University of Munich"))

v(5mm)
align(center, text(font: sans-font, 1.5em, weight: 100, "School of Computation, Information and Technology \n -- Informatics --"))
align(center, text(font: fonts.sans, 1.5em, weight: 100, "School of Computation, Information and Technology \n -- Informatics --"))

v(15mm)

align(center, text(font: sans-font, 1.3em, weight: 100, degree + "’s Thesis in " + program))
align(center, text(font: fonts.sans, 1.3em, weight: 100, degree + "’s Thesis in " + program))
v(8mm)


align(center, text(font: sans-font, 2em, weight: 700, title))
align(center, text(font: fonts.sans, 2em, weight: 700, title))


align(center, text(font: sans-font, 2em, weight: 500, titleGerman))
align(center, text(font: fonts.sans, 2em, weight: 500, titleGerman))

let entries = ()
entries.push(("Author: ", author))
Expand Down
9 changes: 4 additions & 5 deletions layout/transparency_ai_tools.typ
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
#import "/layout/fonts.typ": *

#let transparency_ai_tools(body) = {
set page(
margin: (left: 30mm, right: 30mm, top: 40mm, bottom: 40mm),
numbering: none,
number-align: center,
)

let body-font = "New Computer Modern"
let sans-font = "New Computer Modern Sans"

set text(
font: body-font,
font: fonts.body,
size: 12pt,
lang: "en"
)
Expand All @@ -20,7 +19,7 @@
)

// --- AI Usage ---
align(left, text(font: sans-font, 20pt, weight: 700,"Transparency in the use of AI tools"))
align(left, text(font: fonts.sans, 20pt, weight: 700,"Transparency in the use of AI tools"))
v(12pt)

body
Expand Down

0 comments on commit 58fd439

Please sign in to comment.