-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathncssm.typ
More file actions
274 lines (254 loc) · 7.15 KB
/
ncssm.typ
File metadata and controls
274 lines (254 loc) · 7.15 KB
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
#import "@preview/pubmatter:0.2.1"
#import "@preview/scienceicons:0.1.0": curvenote-icon
#let leftCaption(it) = context {
set text(size: 8pt)
set align(left)
set par(justify: true)
text(weight: "bold")[#it.supplement #it.counter.display(it.numbering)]
"."
h(4pt)
set text(fill: black.lighten(20%), style: "italic")
it.body
}
#let template(
frontmatter: (),
heading-numbering: "1.1.1",
kind: none,
paper-size: "us-letter",
// The path to a bibliography file if you want to cite some external works.
page-start: none,
max-page: none,
// The paper's content.
body
) = {
let fm = pubmatter.load(frontmatter)
let dates;
if ("date" in fm and type(fm.date) == datetime) {
dates = ((title: "Published", date: fm.date),)
} else {
dates = date
}
// Set document metadata.
set document(title: fm.title, author: fm.authors.map(author => author.name))
let theme = (color: rgb("#C18849"), font: "Noto Sans")
set page(
paper: paper-size,
margin: (left: 25%),
header: pubmatter.show-page-header(fm),
footer: block(
width: 100%,
stroke: (top: 1pt + gray),
inset: (top: 8pt, right: 2pt),
context [
#set text(font: theme.font, size: 9pt, fill: gray.darken(50%))
Morganton Scientific | Volume 2 | 2024 - 2025
#h(1fr)
#counter(page).display()
]
),
)
if (page-start != none) {
context [
#counter(page).update(page-start)
]
}
state("THEME").update(theme)
let logo = [
#image("logo.png")
#v(-13pt)
#align(left)[
#text(size: 19pt, weight: "bold", fill: rgb("#000000"), font: theme.font)[Morganton Scientific]
#v(-6pt)
#text(size: 12pt, style: "italic", weight: "light", fill: rgb("#000000"), font: theme.font)[North Carolina School of Science and Mathematics]
]
#v(5pt)
#set par(justify: true)
#text(size: 6pt, fill: black.lighten(20%), font: theme.font)[
Journal of Student STEM Research
]
// #text(size: 6pt, fill: black.lighten(40%), font: theme.font)[
// ISSN: 2575-9752
// ]
]
show link: it => [#text(fill: theme.color)[#it]]
show ref: it => {
if (it.element == none) {
// This is a citation showing 2024a or [1]
show regex("([\d]{1,4}[a-z]?)"): it => text(fill: theme.color, it)
it
return
}
// The rest of the references, like `Figure 1`
set text(fill: theme.color)
it
}
// Set the body font.
set text(font: "Noto Serif", size: 9pt)
// Configure equation numbering and spacing.
set math.equation(numbering: "(1)")
show math.equation: set block(spacing: 1em)
// Configure lists.
set enum(indent: 10pt, body-indent: 9pt)
set list(indent: 10pt, body-indent: 9pt)
// Configure headings.
set heading(numbering: heading-numbering)
show heading: it => context {
let loc = here()
// Find out the final number of the heading counter.
let levels = counter(heading).at(loc)
set text(10pt, weight: 400)
if it.level == 1 [
// First-level headings are centered smallcaps.
// We don't want to number of the acknowledgment section.
#let is-ack = it.body in ([Acknowledgment], [Acknowledgement],[Acknowledgments], [Acknowledgements])
// #set align(center)
#set text(if is-ack { 10pt } else { 12pt })
#show: smallcaps
#v(20pt, weak: true)
#if it.numbering != none and not is-ack {
numbering(heading-numbering, ..levels)
[.]
h(7pt, weak: true)
}
#it.body
#v(13.75pt, weak: true)
] else if it.level == 2 [
// Second-level headings are run-ins.
#set par(first-line-indent: 0pt)
#set text(style: "italic")
#v(10pt, weak: true)
#if it.numbering != none {
numbering(heading-numbering, ..levels)
[.]
h(7pt, weak: true)
}
#it.body
#v(10pt, weak: true)
] else [
// Third level headings are run-ins too, but different.
#if it.level == 3 {
numbering(heading-numbering, ..levels)
[. ]
}
_#(it.body):_
]
}
if (logo != none) {
place(
top,
dx: -33%,
float: false,
box(
width: 27%,
{
if (type(logo) == content) {
logo
} else {
image(logo, width: 100%)
}
},
),
)
}
// Title and subtitle
pubmatter.show-title-block(fm)
let corresponding = fm.authors.filter((author) => "email" in author).at(0, default: none)
let margin = (
if corresponding != none {
(
title: "Correspondence to",
content: [
#corresponding.name\
#link("mailto:" + corresponding.email)[#corresponding.email]
],
)
},
(
title: [Open Access #h(1fr) #pubmatter.show-license-badge(fm)],
content: [
#set par(justify: true)
#set text(size: 7pt)
#pubmatter.show-copyright(fm)
]
),
if fm.at("github", default: none) != none {
(
title: "Data Availability",
content: [
Source code available:\
#link(fm.github, fm.github)
],
)
},
).filter((m) => m != none)
place(
left + bottom,
dx: -33%,
dy: -10pt,
box(width: 27%, {
set text(font: theme.font)
if (kind != none) {
show par: set par(spacing: 0em)
text(11pt, fill: theme.color, weight: "semibold", smallcaps(kind))
parbreak()
}
if (dates != none) {
let formatted-dates
grid(columns: (40%, 60%), gutter: 7pt,
..dates.zip(range(dates.len())).map((formatted-dates) => {
let d = formatted-dates.at(0);
let i = formatted-dates.at(1);
let weight = "light"
if (i == 0) {
weight = "bold"
}
return (
text(size: 7pt, fill: theme.color, weight: weight, d.title),
text(size: 7pt, d.date.display("[month repr:short] [day], [year]"))
)
}).flatten()
)
}
v(2em)
grid(columns: 1, gutter: 2em, ..margin.map(side => {
text(size: 7pt, {
if ("title" in side) {
text(fill: theme.color, weight: "bold", side.title)
[\ ]
}
set enum(indent: 0.1em, body-indent: 0.25em)
set list(indent: 0.1em, body-indent: 0.25em)
side.content
})
}))
}),
)
place(
left + bottom,
dx: -33%,
dy: 20pt,
box(width: 27%, {
link("https://curvenote.com")[#text(size: 8pt)[#curvenote-icon(color: rgb("#355E98")) #text(fill: rgb("#355E98"), font: "Avenir")[Published by Curvenote]]]
}),
)
if ("abstracts" in fm) {
pubmatter.show-abstract-block(fm)
} else if ("keywords" in fm) {
pubmatter.show-keywords(fm)
}
show par: set par(spacing: 1.4em)
show raw.where(block: true): (it) => {
set text(size: 8pt)
block(fill: luma(240), width: 100%, inset: 10pt, radius: 1pt, it)
}
show figure.caption: leftCaption
set figure(placement: auto)
set bibliography(title: text(10pt, "References"), style: "ieee")
show bibliography: (it) => {
set text(7pt)
set block(spacing: 0.9em)
it
}
// Display the paper's contents.
body
}