From 556aa527c8f1b37d40a818a8273cad4e136f73d6 Mon Sep 17 00:00:00 2001 From: Oschly Date: Fri, 5 Jun 2026 13:34:58 +0200 Subject: [PATCH] Fix heading styling --- Thesis/Bibliography.typ | 5 ++- Thesis/main.pdf | 4 +-- Thesis/main.typ | 5 +-- Thesis/style.typ | 73 +++++++++++++++++++++++++++++++++++++++-- 4 files changed, 78 insertions(+), 9 deletions(-) diff --git a/Thesis/Bibliography.typ b/Thesis/Bibliography.typ index a26e520..d2cfe72 100644 --- a/Thesis/Bibliography.typ +++ b/Thesis/Bibliography.typ @@ -43,7 +43,7 @@ #let render-bib() = { load-bibliography("Bibliography.bib", prefix: "cite:", full: true, style: "ieee") - heading(level: 1)[Spis literatury] + heading(level: 1, outlined: false)[Spis literatury] v(1em) context { @@ -180,7 +180,7 @@ let render-group(title, keys, start-idx) = { if keys.len() > 0 [ - == #title + #heading(level: 2, title, outlined: false) #grid( columns: (auto, 1fr), column-gutter: 0.65em, @@ -191,7 +191,6 @@ let entry = get-entry(k) if entry == none { return () } let num = start-idx + i + 1 - // Pamiętaj: musisz użyć format-custom, który wkleiłeś wyżej! ([\[#num\]], [#format-custom(entry)#label("cite:" + k)]) }) .flatten() diff --git a/Thesis/main.pdf b/Thesis/main.pdf index 551d22b..6f47334 100644 --- a/Thesis/main.pdf +++ b/Thesis/main.pdf @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6a89847ff2c07b6401c5baf87905d4ca9281639c264b15605c37d1376059e619 -size 1651831 +oid sha256:a30e66d4ae6abf6b6c6324168bff5cfd4ad3b9739bd347fa7eded657c9cde39a +size 1641334 diff --git a/Thesis/main.typ b/Thesis/main.typ index 1d8ce98..a2d9fc5 100644 --- a/Thesis/main.typ +++ b/Thesis/main.typ @@ -18,6 +18,7 @@ #include "Chapters/2. Implementation.typ" #include "Chapters/3. Tests.typ" #include "Chapters/4. Summary.typ" + #render-bib() + #pagebreak(to: "odd") + #list-of-figures() ]) - -#render-bib() diff --git a/Thesis/style.typ b/Thesis/style.typ index 78329e1..ae0db3c 100644 --- a/Thesis/style.typ +++ b/Thesis/style.typ @@ -168,7 +168,7 @@ set heading(numbering: "1.1") show heading: it => { - let num = if it.numbering != none { + let num = if it.numbering != none and it.outlined { counter(heading).display(it.numbering) } @@ -336,6 +336,75 @@ body } // /zut-template + +/// Spis rysunków – wywołaj jako ostatni element wewnątrz zut-template. +/// +/// Wyszukuje wszystkie figure(kind: image) w dokumencie i odtwarza +/// numery X.Y identyczne z tymi generowanymi przez show figure.where(kind: image) +/// w zut-template. +#let list-of-figures() = { + [ + #set heading(numbering: none) + #show heading: it => { + v(1em) + + block(width: 100%, inset: (bottom: 3em, top: 7em, left: 2em))[ + #align(left)[ + #text(size: 25pt, fill: blue-zut, weight: "regular", font: "Fira Sans", it.body) + ] + ] + } + #heading(level: 1, outlined: false)[Spis rysunków] + ] + + context { + let all-figs = query(figure.where(kind: image)) + + let local = 1 + let prev-ch = -1 + + for fig in all-figs { + let ch = counter(heading.where(level: 1)).at(fig.location()).first() + + if ch != prev-ch { + local = 0 + prev-ch = ch + } + local = local + 1 + + let full-number = str(ch) + "." + str(local) + let pg = counter(page).at(fig.location()).first() + let cap = fig.caption.body + + v(8pt, weak: true) + link(fig.location())[ + #grid( + columns: (3em, 1fr, auto), + align: (left, left, right), + text( + size: 11pt, + weight: "regular", + font: "Fira Sans", + )[#full-number], + // Podpis + wypełnienie kropkami + [ + #text(size: 11pt, font: "Fira Sans")[#cap] + #box(width: 1fr, inset: (x: 0pt))[ + #text[#repeat[ . ]] + ] + ], + // Numer strony + text( + size: 10pt, + weight: "regular", + font: "Fira Sans", + )[#pg], + ) + ] + } + } +} + /// Funkcja rysująca abstrakt – polska wersja u góry, angielska na dole, jedna strona A4. /// /// Parametry: @@ -368,7 +437,7 @@ set text(font: "New Computer Modern", size: 12pt, lang: "pl") set par(justify: true, leading: 0.65em) - set heading(numbering: none) + set heading(numbering: none, outlined: false) show heading: it => { if it.level == 1 {