//  !!!!
//  STUDENTS, DO NOT EDIT THIS FILE!
//  !!!!

#import "../projectInfo.typ": student, report

#let chapter(
  content: "Add a content argument to function call",
  chapterTitle: "Chapter Title",
  body
) = {

let topMargin = 2.5cm+1.35cm
show heading.where(depth: 1): it => block(it.body);
set page(
  numbering: "1",
  header: 
  [
    #locate(loc => {
      let titlePage = counter(page).at(label(lower(chapterTitle))).first()
      let thisPage = counter(page).at(loc).first()
      set align(if calc.rem(thisPage, 2) == 0 { left } else { right })
      if thisPage != titlePage {counter(page).display("1"); v(-9pt) ; line(length: 100%, stroke: 0.5pt)} else {}
    })
  ],
  header-ascent: 21.4%,
  footer-descent: 9%,
  footer:
  [
    #locate(loc => {
      let n = counter(page).at(loc).first()
      if calc.rem(n,2) == 0 {
        [
        #stack(dir: ltr,
        text(font: "New Computer Modern Sans")[#student.name],
        align(right)[#text(font: "New Computer Modern Sans")[#report.type]])
        ]
      } 
      else {
        [
        #stack(dir: ltr,
        text(font: "New Computer Modern Sans")[#report.type],
        align(right)[#text(font: "New Computer Modern Sans")[#student.name]])
        ]
      }
    })
  ]
)
set align(top)
v(116pt-topMargin+3.02cm)
  line(length: 100%, stroke: 2pt)
  let pad = 5pt
  v(pad)
  align(top+right,

    [    #context{
        let n = counter(heading).get().first()+1
        [#text(size: 25pt, weight: 0, style: "normal",font: "New Computer Modern")[Chapter #n]]
      }])
  v(pad)
  line(length: 100%, stroke: 2pt)
  v(-20pt)
  align(
    right,
    //[#text(size: 24.4pt, font: "New Computer Modern Sans", weight: "bold")[#chapterTitle ]#label(lower(chapterTitle))]
    text(size: 20pt, font: "New Computer Modern Sans")[#heading(outlined: true,[#chapterTitle])#label(lower(chapterTitle))]
  )
  v(87pt)
  set text(size: 10.5pt,font: "New Computer Modern Math", weight: 500)

[#content]

pagebreak(to: "even", weak: true)
body
}