generated from onefact/datathinking.org-report-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
datathinking.org-report-template.typ
134 lines (120 loc) · 2.83 KB
/
datathinking.org-report-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
#let script-size = 7.97224pt
#let footnote-size = 8.50012pt
#let small-size = 9.24994pt
#let normal-size = 10.00002pt
#let large-size = 11.74988pt
#let datathinking(
title: none,
authors: (),
abstract: [],
body,
) = {
// Formats the author's names in a list with commas and a
// final "and".
let names = authors.map(author => author.name)
let author-string = if authors.len() == 2 {
names.join(" and ")
} else {
names.join(", ", last: ", and ")
}
// Set document metadata.
set document(title: title, author: names)
// Set and show rules from before.
//...
show link: underline
// Configure citation and bibliography styles.
set cite(style: "chicago-author-date")
set bibliography(style: "apa", title: "references")
// FIGURES
show figure: it => {
set align(left)
show: pad.with(x: 13pt)
v(12.5pt, weak: true)
// Display the figure's body.
it.body
// Display the figure's caption.
if it.has("caption") {
// Gap defaults to 17pt.
v(if it.has("gap") { it.gap } else { 17pt }, weak: true)
smallcaps[figure]
if it.numbering != none {
[ #smallcaps[#counter(figure).display(it.numbering)]]
}
[. ]
it.caption
}
v(15pt, weak: true)
}
show heading: it => [
#set align(left)
#set text(12pt, weight: "regular")
#block(smallcaps(it.body))
]
// Configure headings.
set heading(numbering: "1.")
show heading: it => {
// Create the heading numbering.
let number = if it.numbering != none {
counter(heading).display(it.numbering)
h(7pt, weak: true)
}
// Level 1 headings are centered and smallcaps.
// The other ones are run-in.
set text(size: normal-size, weight: 400)
if it.level == 1 {
set align(center)
set text(size: normal-size)
smallcaps[
#v(15pt, weak: true)
#number
#it.body
#v(normal-size, weak: true)
]
counter(figure.where(kind: "theorem")).update(0)
} else {
v(11pt, weak: true)
number
let styled = if it.level == 2 { strong } else { emph }
styled(it.body + [. ])
h(7pt, weak: true)
}
}
// PAGE NUMBERING
set text(8pt)
set page(
footer: [
#align(right)[
#counter(page).display(
"1 of I",
both: true,
)
]
]
)
set align(center)
text(17pt, weight: "bold", title)
let count = authors.len()
let ncols = calc.min(count, 3)
grid(
columns: (1fr,) * ncols,
row-gutter: 24pt,
..authors.map(author => [
#author.name \
#author.affiliation \
#link("mailto:" + author.email)
]),
)
set align(left)
set pad(x: 60pt)
par(justify: true)[
#block(
fill: luma(230),
inset: 8pt,
radius: 4pt,
smallcaps[project abstract. ] + abstract,
)
//#abstract
]
set align(left)
columns(2, body)
}