Files
praca_inzynierska/Thesis/table_of_contents.typ
T
2026-05-05 22:14:54 +02:00

56 lines
1.3 KiB
Typst

#import "style.typ": definition, example, theorem, zut-template
#let color-dark-blue = rgb("#223d73")
#let color-page-num = rgb("#6b7b96")
#let color-dots = rgb("#a0aabf")
#set heading(numbering: "1.1")
#set text(font: "Fira Sans")
#set outline(title: text(size: 24pt, fill: color-dark-blue, weight: "regular")[Spis treści])
#show outline.entry: it => {
let is-lvl-1 = it.level == 1
let num = it.prefix()
let title = it.body()
let page-num = it.page()
let num-style = if is-lvl-1 {
text(size: 14pt, fill: color-dark-blue, num)
} else {
text(size: 12pt, fill: black, num)
}
let title-style = if is-lvl-1 {
text(size: 14pt, fill: color-dark-blue, title)
} else {
text(size: 12pt, fill: black, title)
}
let page-style = text(size: 10pt, fill: color-page-num, weight: "medium", page-num)
v(if is-lvl-1 { 14pt } else { 6pt }, weak: true)
link(it.element.location())[
#grid(
columns: (3em, 1fr, auto),
align: (left, left, right),
// Kolumna 1: Numery rozdziałów w jednej linii
num-style,
// Kolumna 2: Tytuł oraz kropki
[
#title-style
#box(width: 1fr, inset: (x: 5pt))[
#text(fill: color-dots)[#repeat[ . ]]
]
],
// Kolumna 3: Numer strony
page-style,
)
]
}
#outline()
#pagebreak()