File size: 1,022 Bytes
fdbb2bf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#set page(
  paper: "a4",
  header: [
    #set align(right)
    #context{
      let current_page=here().page()
      let all-h1 = query(heading.where(level: 1))
      let is-chapter-start = all-h1.any(h => h.location().page() == current_page)
      let x=counter(page).get().first()

      if is-chapter-start [
        #counter(page).display()
        #place(line(start:(0%,10%),end: (100%,10%),stroke: 2pt+black))
        #place(line(start:(0%,18%),end: (100%,18%)))
      ]
      else[
        #grid(
          columns: (0.1fr,2fr,0.1fr),
          align: (left,center,right),
          [],[aaaaaaaaa],[#counter(page).display()]
        )
        #place(line(start:(0%,10%),end: (100%,10%)))
      ]
    }
  ],
  footer: [
    #place(line(start:(0%,0%),end: (100%,0%)))\
    bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
  ],
)
#set par(justify: true)
= aaaaa
#lorem(500)
== test02
#lorem(800)
= bbbbb
#lorem(500)
== test03
#lorem(300)
= ccccc
#lorem(400)
== test04
#lorem(300)