-
Notifications
You must be signed in to change notification settings - Fork 2
/
template.typ
139 lines (129 loc) · 2.82 KB
/
template.typ
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
#let arkheion(
title: "",
abstract: [],
keywords: (),
authors: (),
date: none,
body,
) = {
// Set the document's basic properties.
set document(author: authors.map(a => a.name), title: title)
set page(
margin: (left: 25mm, right: 25mm, top: 25mm, bottom: 30mm),
numbering: "1",
number-align: center,
)
set text(font: "New Computer Modern", lang: "en")
show math.equation: set text(weight: 400)
show math.equation: set block(spacing: 0.65em)
set math.equation(numbering: "(1)")
set heading(numbering: "1.1")
// Set run-in subheadings, starting at level 4.
show heading: it => {
// H1 and H2
if it.level == 1 {
pad(
bottom: 10pt,
it
)
}
else if it.level == 2 {
pad(
bottom: 8pt,
it
)
}
else if it.level > 3 {
text(11pt, weight: "bold", it.body + " ")
} else {
it
}
}
line(length: 100%, stroke: 2pt)
// Title row.
pad(
bottom: 4pt,
top: 4pt,
align(center)[
#block(text(weight: 500, 1.75em, title))
#v(1em, weak: true)
]
)
line(length: 100%, stroke: 2pt)
// Author information.
pad(
top: 0.5em,
x: 2em,
grid(
columns: (1fr,) * calc.min(3, authors.len()),
gutter: 1em,
..authors.map(author => align(center)[
#if author.keys().contains("orcid") {
link("http://orcid.org/" + author.orcid)[
#pad(bottom: -8pt,
grid(
columns: (8pt, auto, 8pt),
rows: 10pt,
[],
[*#author.name*],
[
#pad(left: 4pt, top: -4pt, image("orcid.svg", width: 8pt))
]
)
)
]
} else {
grid(
columns: (auto),
rows: 2pt,
[*#author.name*],
)
}
#author.email \
#author.affiliation
]),
),
)
align(center)[#date]
// Abstract.
pad(
x: 3em,
top: 1em,
bottom: 0.4em,
align(center)[
#heading(
outlined: false,
numbering: none,
text(0.85em, smallcaps[Abstract]),
)
#set par(justify: true)
#set text(hyphenate: false)
#abstract
],
)
// Keywords
if keywords.len() > 0 {
[*_Keywords_* #h(0.3cm)] + keywords.map(str).join(" · ")
}
// Main body.
set par(justify: true)
set text(hyphenate: false)
body
}
#let arkheion-appendices(body) = {
counter(heading).update(0)
counter("appendices").update(1)
set heading(
numbering: (..nums) => {
let vals = nums.pos()
let value = "ABCDEFGHIJ".at(vals.at(0) - 1)
if vals.len() == 1 {
return "APPENDIX " + value
}
else {
return value + "." + nums.pos().slice(1).map(str).join(".")
}
}
);
[#pagebreak() #body]
}