-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.typ
128 lines (115 loc) · 3.04 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
#let project(
paper_code: "",
title: "",
abstract: [],
authors: (),
organizations: (),
keywords: (),
header: [],
body,
) = {
// Set the document's basic properties.
set document(author: authors.map(a => a.name), title: title)
set page(
paper: "us-letter",
header: align(center, text(8pt, header)),
footer: grid(
columns: (1fr, 1fr),
align(left)[
#paper_code
],
align(right)[
Page
#counter(page).display(
"1 of 1",
both: true,
)
]
),
)
set text(font: "Times New Roman", lang: "en", size: 10pt)
// Paper code
align(center)[
#block(text(paper_code))
#v(1.3em, weak: true)
]
// Title row.
align(center)[
#block(text(weight: 700, title))
#v(1.3em, weak: true)
]
// Authors
align(center)[
#authors.enumerate(start: 1).map(ia => [
#let (index, author) = ia
#let author_key = numbering("a", index)
#set text(weight: "bold")
#box[#author.name#super(author_key)#if author.at("corresponding", default: false) {sym.ast.basic}]]).join(", ")
#v(1.3em, weak: true)
]
// Author affiliations
align(left)[
#authors.enumerate(start: 1).map(ia => [
#let (index, author) = ia
#let author_key = numbering("a", index)
#set text(style: "italic")
#let org = organizations.find(o => o.name == author.affiliation)
#super(author_key) #org.display#if author.email != none {[, #text(style: "normal",underline[#link("mailto:" + author.email)])]}
]).join(linebreak())
#linebreak()
#sym.ast.basic Corresponding Author
]
v(1.3em, weak: true)
// Abstract.
align(center)[*Abstract*]
{
set par(justify: true, first-line-indent: 0.5cm)
abstract
}
// Keywords.
if keywords.len() > 6 {
panic("Too many keywords. Please limit to 6.")
}
else if keywords.len() > 0 {
[*Keywords:* #keywords.join(", ")]
}
v(1.3em, weak: true)
// Main body.
set heading(numbering: (..numbers) => if numbers.pos().len() <= 1 {
numbers.pos().map(str).join(".") + "."
} else {
numbers.pos().map(str).join(".")
})
show heading.where(level: 1): it => [
#set text(size: 10pt)
#set heading(numbering: "1.1.1")
#it
]
show heading.where(level: 2): it => [
#set text(size: 10pt, weight: "regular", style: "italic")
#it
]
show heading.where(level: 3): it => [
#set text(size: 10pt, weight: "regular", style: "italic")
#it
]
// Figure show rule
show figure.where(kind: image): it => align(center)[
#v(0.65em)
#block(below: 0.65em)[#it.body]
#it.supplement #it.counter.display(it.numbering). #it.caption.body
#v(0.65em)
]
// Table show rule
show figure.where(kind: table): it => align(center)[
#v(0.65em)
#it.supplement #it.counter.display(it.numbering). #it.caption.body
#block(above: 0.65em)[#it.body]
#v(0.65em)
]
show par: set block(spacing: 0.65em)
set par(justify: true, first-line-indent: 0.5cm)
show: columns.with(2, gutter: 1.3em)
set math.equation(numbering: "(1)")
body
}