-
Notifications
You must be signed in to change notification settings - Fork 349
/
Copy pathtypst-title.typ
65 lines (61 loc) · 1.56 KB
/
typst-title.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
#let title_block(
title: none,
subtitle: none,
authors: none,
date: none,
abstract: none,
title-size: none,
subtitle-size: none,
heading-family: none,
heading-weight: none,
heading-style: none,
heading-color: none,
heading-line-height: none
) = {
if title != none {
align(center)[#block(inset: 2em)[
#set par(leading: heading-line-height)
#if (heading-family != none or heading-weight != "bold" or heading-style != "normal"
or heading-color != black or heading-decoration == "underline"
or heading-background-color != none) {
set text(font: heading-family, weight: heading-weight, style: heading-style, fill: heading-color)
text(size: title-size)[#title]
if subtitle != none {
parbreak()
text(size: subtitle-size)[#subtitle]
}
} else {
text(weight: "bold", size: title-size)[#title]
if subtitle != none {
parbreak()
text(weight: "bold", size: subtitle-size)[#subtitle]
}
}
]]
}
if authors != none {
let count = authors.len()
let ncols = calc.min(count, 3)
grid(
columns: (1fr,) * ncols,
row-gutter: 1.5em,
..authors.map(author =>
align(center)[
#author.name \
#author.affiliation \
#author.email
]
)
)
}
if date != none {
align(center)[#block(inset: 1em)[
#date
]]
}
if abstract != none {
block(inset: 2em)[
#text(weight: "semibold")[#abstract-title] #h(1em) #abstract
]
}
}