diff --git a/Thesis/main.pdf b/Thesis/main.pdf index a9f3fc0..5b7c9e3 100644 --- a/Thesis/main.pdf +++ b/Thesis/main.pdf @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9b98db1243fe062aaf8d65fa478222668d677f2edbd2f606896090e0d71efacc -size 1639976 +oid sha256:5b2a33a3b84bec49d44baf464d659aa4ea4a1bc7833b44081b11fbb36b64b7c7 +size 1638334 diff --git a/Thesis/style.typ b/Thesis/style.typ index 2aed6ed..aa9c14a 100644 --- a/Thesis/style.typ +++ b/Thesis/style.typ @@ -92,7 +92,18 @@ let chapter-locs = query(heading.where(level: 1)) let is-chapter-page = chapter-locs.any(h => counter(page).at(h.location()).first() == pg) - if chapter-locs.len() == 0 {} else if not is-chapter-page { + // Detect blank pages inserted by pagebreak(to: "odd"). + // The marker is placed before the pagebreak, so it lands on the last page + // of the previous chapter (pg - 1 relative to the blank even page). + let chapter-break-markers = query() + let is-blank-page = ( + not is-odd + and chapter-break-markers.any( + m => counter(page).at(m.location()).first() == pg - 1, + ) + ) + + if chapter-locs.len() == 0 {} else if not is-chapter-page and not is-blank-page { // Tytuł bieżącego rozdziału do nagłówka let prev = query(heading.where(level: 1).before(here())) let ch-label = if prev.len() > 0 { @@ -174,6 +185,9 @@ if it.level == 1 { // Wymuszenie nowej strony dla głównego rozdziału + // Marker placed before the break so it appears on the last page of the + // previous chapter; used by the header to detect blank even pages. + [#metadata("chapter-break") ] pagebreak(to: "odd", weak: true) v(1.5em, weak: true)