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" #import "template.typ"
#show: doc => template.phd(doc) #show: doc => template.phd(doc)
@ -18,6 +19,43 @@
#include "introduction/main.typ" #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 "foreword/main.typ"
#include "related-work/main.typ" #include "related-work/main.typ"
@ -28,6 +66,8 @@
#include "mobile/main.typ" #include "mobile/main.typ"
#show: doc => { set page(header: [], footer: []); doc }
#pagebreak() #pagebreak()
#bibliography("bib.bib", style: "chicago-author-date") #bibliography("bib.bib", style: "chicago-author-date")

View File

@ -65,6 +65,20 @@
}) })
show heading.where(level: 1): it => { show heading.where(level: 1): it => {
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, { align(right, {
v(100pt) v(100pt)
if it.numbering != none { if it.numbering != none {
@ -77,6 +91,7 @@
v(40pt) v(40pt)
}) })
} }
}
show heading.where(level: 2): set text(size: 15pt) show heading.where(level: 2): set text(size: 15pt)
show heading.where(level: 3): set text(size: 13pt) show heading.where(level: 3): set text(size: 13pt)
@ -85,17 +100,8 @@
} }
#let beforeChapter = () => { #let beforeChapter = () => {
pagebreak(to: "odd")
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()
}
})
} }
#let afterNumberedChapter = () => { #let afterNumberedChapter = () => {
pagebreak()
} }