fleshed out the introductory sections

This commit is contained in:
2025-09-06 12:13:53 +02:00
parent 3f4fb35555
commit 9045c95ddd
16 changed files with 615 additions and 249 deletions

View File

@@ -29,10 +29,13 @@
//
set document(author: authors, title: title, description: subtitle)
// Set body font family.
set text(font: font, 11pt)
show heading: set text(font: font, fill: background-color)
let font-color = color;
// Check if the background color is closer to black or white
let components = background-color.components()
// show the components for debugging
let luminance = float(0.299 * components.at(0) + 0.587 * components.at(1) + 0.114 * components.at(2))
if luminance > 0.5 {
font-color = color.black
@@ -41,41 +44,54 @@
}
//customize look of figure
// set figure.caption(separator: [ --- ], position: top)
//customize inline raw code
show raw.where(block: false) : it => h(0.5em) + box(fill: color.lighten(90%), outset: 0.2em, it) + h(0.5em)
// Set body font family.
set text(font: font, 12pt)
show heading: set text(font: font, fill: background-color)
// add space for heading
show heading.where(level:1): it => it + v(0.5em)
// Set link style
// color links
show link: it => underline(text(fill: background-color, it))
show ref: it => text(fill: background-color, it)
show ref.where(): it => text(fill: background-color, it)
//numbered list colored
// colors lists
set enum(indent: 1em, numbering: n => [#text(fill: background-color, numbering("1.", n))])
//unordered list colored
set list(indent: 1em, marker: n => [#text(fill: background-color, "•")])
// citation style
set cite(
form: "prose"
)
// add space for heading
show heading.where(level:1): it => it + v(0.5em)
//
// Included content
//
// figures
// set figure.caption(separator: [ --- ], position: top)
// code blocks
show raw.where(block: true) : it => h(0.5em) + box(fill: background-color.lighten(80%), outset: 0.5em, width: 100%, it) + h(0.5em)
// display of outline entries
show outline.entry: it => text(size: 12pt, weight: "regular",it)
let authors_block(authors, denomination: "Author") = {
if authors.len() == 0 {
return
}
let prefix = denomination
if authors.len() > 2 {
prefix += "s"
}
stack(
dir: ltr,
text(prefix + ": ", weight: 600),
stack(
dir: ttb,
spacing: 0.5em,
..authors
)
)
}
//
// Title page
@@ -93,16 +109,19 @@
background-image
)
// define the base widht of a tile, as a tenth of the page width
let tile_width = 1.51cm
// Add a tiling of white squares over the background to simulate a grid
for i in range(0, 14) {
for j in range(0, 14) {
place(
bottom + right,
dx: -i * 3.55em + 0.1em,
dy: -j * 3.55em,
dx: -i * tile_width + 0.1em,
dy: -j * tile_width,
)[
#square(
size: 3.55em,
size: tile_width,
// fill: gradient.linear(
// color.white,
// color.black.transparentize(0%),
@@ -177,7 +196,6 @@
),
)
// add a few more tiles *above* the background image to simulate a grid structure
let draw_pairs = (
(0, 10),
@@ -261,19 +279,11 @@
for (i, j) in draw_pairs {
place(
bottom + right,
dx: -i * 3.55em + 0.1em,
dy: -j * 3.55em,
dx: -i * tile_width + 0.1em,
dy: -j * tile_width,
)[
#square(
size: 3.55em,
// fill: gradient.linear(
// color.white,
// color.black.transparentize(0%),
// color.black.transparentize(0%),
// color.black.transparentize(0%),
// color.black.transparentize(0%),
// angle: 45deg,
// ),
size: tile_width,
fill: none,
stroke: (
paint: color.white,
@@ -281,7 +291,6 @@
)
)
]
}
@@ -290,16 +299,23 @@
x: 4em,
y: 4em,
)[
#align(center, text(font: font, 3em, weight: 700, title, fill: font-color))
#v(2em, weak: true)
#set text(font: font, fill: font-color)
#align(center, text(title, size: 2.5em, weight: 600))
#if subtitle != none {
align(center, text(font: font, 2em, weight: 600, subtitle, fill: font-color))
v(1.5em, weak: true)
align(center, text(subtitle, size: 2em, weight: 500))
}
#v(2em, weak: true)
#align(
center,
text(font: font, 1em, authors.join(", "), fill: font-color)
)
#pad(
x: 6em,
y: 0em,
)[
#stack(
dir: ltr,
authors_block(authors),
h(1fr),
authors_block(supervisors, denomination: "Supervisor")
)
]
]
@@ -355,14 +371,12 @@
footer: footer,
margin: 4em,
)
counter(page).update(1)
//
// Table of contents.
// "First" page - abstract and TOC
//
abstract
v(2em)
outline()
@@ -374,36 +388,8 @@
// Main body.
//
set heading(numbering: "1.")
set par(justify: true)
body
}
// let footer = grid(
// rows: auto,
// v(0mm),
// line(length: 100%, stroke: 0.6pt), // should be 1.6pt according to guidelines
// v(2.5mm),
// text(
// font: "Roboto",
// stretch: 100%,
// fallback: false,
// weight: "regular",
// size: 10pt
// )[
// #set align(right)
// // context needed for page counter for typst >= 0.11.0
// #context [
// #let counter_disp = counter(page).display()
// //#hide(counter_disp)
// //#counter_disp
// #context {
// let after_table_of_contents = query(selector(<__after_table_of_contents>).before(here())).len() >= 1
// if after_table_of_contents {counter_disp}
// else {hide(counter_disp)}
// }
// ]
// ]
// )