This repository has no description
1#let sig(in-between) = stack(
2 dir: ltr,
3 spacing: 0.5em,
4 move(dy: -0.07em, image("heart.png", width: 2%)),
5 in-between,
6 move(dy: -0.15em, image("flag.png", width: 2.5%)),
7)
8
9// From https://github.com/mgoulao/arkheion, slightly tweaked parce que le Français.
10#let arkheion(
11 title: "",
12 headertitle: "",
13 abstract: none,
14 keywords: (),
15 authors: (),
16 custom_authors: none,
17 date: none,
18 logo: none,
19 body,
20) = {
21 // Set the document's basic properties.
22 set document(author: authors.map(a => a.name), title: title)
23 set page(
24 margin: (left: 25mm, right: 25mm, top: 25mm, bottom: 30mm),
25 header: text(
26 fill: luma(30%),
27 stack(
28 dir: ltr,
29 spacing: 2em,
30 align(
31 left,
32 context {
33 let selector = selector(heading).before(here())
34 let level = counter(selector)
35 let headings = query(selector)
36
37 if headings.len() == 0 {
38 return
39 }
40
41 let heading = headings.last()
42
43 if heading.numbering != none [
44 #headertitle ⁄ #heading.body
45 ]
46 },
47 ),
48 align(
49 right,
50 context {
51 let selector = selector(heading).before(here())
52 let level = counter(selector)
53 let headings = query(selector)
54
55 if headings.len() == 0 {
56 return
57 }
58
59 let heading = headings.last()
60 if heading.numbering != none [
61 Ch. #level.display(heading.numbering)
62 ]
63 },
64 ),
65 ),
66 ),
67 numbering: (current, ..total) => if total.pos().len() > 0
68 and current == total.at(0) {
69 sig(str(current))
70 } else {
71 str(current)
72 },
73 number-align: center,
74 )
75 show raw: set text(size: 0.85em, font: ("MartianMono NF", "Martian Mono"))
76 set text(font: "New Computer Modern", lang: "fr")
77 set raw(theme: "snazzylight.tmTheme")
78 show math.equation: set text(weight: 400)
79 show math.equation: set block(spacing: 0.65em)
80 set math.equation(numbering: "(1)")
81 set heading(numbering: "1.1 ")
82 // Écriture inclusive >:3
83 show "·": sym.dot.op
84 // show heading: set text(font: "Martian Mono")
85
86 // Set run-in subheadings, starting at level 4.
87 show heading: it => {
88 // H1 and H2
89 if it.level == 1 {
90 pad(
91 bottom: 10pt,
92 it,
93 )
94 } else if it.level == 2 {
95 pad(
96 bottom: 8pt,
97 it,
98 )
99 } else if it.level > 3 {
100 text(11pt, weight: "bold", it.body + " ")
101 } else {
102 it
103 }
104 }
105
106 pad(
107 x: 0%,
108 y: 30%,
109 {
110 if logo != none {
111 pad(
112 top: 1em,
113 align(center)[
114 #image(logo, width: 80%)
115 ],
116 )
117 }
118
119 if logo == none {
120 line(length: 100%, stroke: 2pt)
121 }
122 // Title row.
123 pad(
124 bottom: 4pt,
125 top: 4pt,
126 align(center)[
127 #block(text(weight: 500, 1.75em, title))
128 #v(1em, weak: true)
129 ],
130 )
131 if logo == none {
132 line(length: 100%, stroke: 2pt)
133 }
134
135 // Author information.
136 if custom_authors != none {
137 custom_authors
138 } else {
139 pad(
140 top: 0.5em,
141 x: 2em,
142 grid(
143 columns: (1fr,) * calc.min(3, authors.len()),
144 gutter: 1em,
145 ..authors.map(author => align(center)[
146 #if author.keys().contains("orcid") {
147 link("http://orcid.org/" + author.orcid)[
148 #pad(
149 bottom: -8pt,
150 grid(
151 columns: (8pt, auto, 8pt),
152 rows: 10pt,
153 [],
154 [*#author.name*],
155 [
156 #pad(
157 left: 4pt,
158 top: -4pt,
159 image("orcid.svg", width: 8pt),
160 )
161 ],
162 ),
163 )
164 ]
165 } else {
166 grid(
167 columns: auto,
168 rows: 2pt,
169 [*#author.name*],
170 )
171 }
172 #author.email \
173 #author.affiliation
174 ]),
175 ),
176 )
177 }
178
179 align(center)[#date]
180
181 // Abstract.
182 if abstract != none {
183 pad(
184 x: 3em,
185 top: 1em,
186 bottom: 0.4em,
187 align(center)[
188 #heading(
189 outlined: false,
190 numbering: none,
191 text(0.85em, smallcaps[Introduction]),
192 )
193 #set par(justify: true)
194 #set text(hyphenate: false)
195
196 #abstract
197 ],
198 )
199 }
200
201 // Keywords
202 if keywords.len() > 0 {
203 [*_Mots clés_* #h(0.3cm)] + keywords.map(str).join(" · ")
204 }
205 },
206 )
207
208 // Main body.
209 set par(justify: true)
210 set text(hyphenate: false)
211
212 body
213}
214
215#let monospace = body => {
216 text(font: "Martian Mono", size: 0.7em, body)
217}
218
219#let arkheion-appendices(body) = {
220 counter(heading).update(0)
221 counter("appendices").update(1)
222
223 set heading(
224 numbering: (..nums) => {
225 let vals = nums.pos()
226 let value = "ABCDEFGHIJ".at(vals.at(0) - 1)
227 if vals.len() == 1 {
228 return value
229 } else {
230 return value + "." + nums.pos().slice(1).map(str).join(".")
231 }
232 },
233 )
234 [#pagebreak() #body]
235}