This commit is contained in:
Thomas Forgione 2024-07-09 11:45:16 +02:00
parent 8b3a0cb91e
commit b5d83ba7de
2 changed files with 67 additions and 21 deletions

View File

@ -1,3 +1,4 @@
#import "@preview/chic-hdr:0.4.0": *
#import "template.typ"
#show: doc => template.phd(doc)
@ -18,6 +19,43 @@
#include "introduction/main.typ"
#show: chic.with(
odd: (
chic-footer(
right-side: chic-page-number(),
),
chic-header(
right-side: context {
[ #counter(heading).display((..args) => {
let arr = args.pos()
if arr.len() == 1 {
arr.at(0)
} else {
str(arr.at(0)) + "." + str(arr.at(1))
}
})
#chic-heading-name(fill: true, level: 2, dir: "prev") ]
},
),
chic-separator(1pt),
chic-offset(7pt),
chic-height(1.5cm)
),
even: (
chic-footer(
left-side: chic-page-number(),
),
chic-header(
left-side: context {
[ Chapter #counter(heading).get().at(0) #chic-heading-name(fill: true, level: 1, dir: "prev") ]
},
),
chic-separator(1pt),
chic-offset(7pt),
chic-height(1.5cm)
),
)
#include "foreword/main.typ"
#include "related-work/main.typ"
@ -28,6 +66,8 @@
#include "mobile/main.typ"
#show: doc => { set page(header: [], footer: []); doc }
#pagebreak()
#bibliography("bib.bib", style: "chicago-author-date")

View File

@ -65,17 +65,32 @@
})
show heading.where(level: 1): it => {
align(right, {
v(100pt)
if it.numbering != none {
text(size: 50pt, weight: "bold")[Chapter ]
set heading(numbering: (..nums) => str(nums.pos().at(0)))
text(counter(heading).display(), size: 150pt, fill: rgb(173, 216, 230))
}
v(50pt)
text(it.body, size: 40pt, weight: "bold")
v(40pt)
})
if it.numbering != none {
set page(header: [], footer: [])
align(right, {
v(100pt)
if it.numbering != none {
text(size: 50pt, weight: "bold")[Chapter ]
set heading(numbering: (..nums) => str(nums.pos().at(0)))
text(counter(heading).display(), size: 150pt, fill: rgb(173, 216, 230))
}
v(50pt)
text(it.body, size: 40pt, weight: "bold")
v(40pt)
})
} else {
align(right, {
v(100pt)
if it.numbering != none {
text(size: 50pt, weight: "bold")[Chapter ]
set heading(numbering: (..nums) => str(nums.pos().at(0)))
text(counter(heading).display(), size: 150pt, fill: rgb(173, 216, 230))
}
v(50pt)
text(it.body, size: 40pt, weight: "bold")
v(40pt)
})
}
}
show heading.where(level: 2): set text(size: 15pt)
@ -85,17 +100,8 @@
}
#let beforeChapter = () => {
pagebreak()
locate(loc => {
// This is not fully working but I don't know how to do better
if calc.rem(loc.position().page, 2) == 0 {
pagebreak()
}
})
pagebreak(to: "odd")
}
#let afterNumberedChapter = () => {
pagebreak()
}