-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathlayouts.typ
159 lines (135 loc) · 4.27 KB
/
layouts.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
#let _default-layout = (
"spacing": 1.2em,
)
#let layout-a0 = _default-layout + (
"paper": "a0",
"size": (841mm, 1188mm),
"body-size": 33pt,
"heading-size": 50pt,
"title-size": 75pt,
"subtitle-size": 60pt,
"authors-size": 50pt,
"keywords-size": 40pt,
)
#let layout-a1 = _default-layout + (
"paper": "a1",
"size": (594mm, 841mm),
"body-size": 27pt,
"heading-size": 41pt,
"title-size": 61pt,
"subtitle-size": 49pt,
"authors-size": 41pt,
"keywords-size": 33pt,
)
#let layout-a2 = _default-layout + (
"paper": "a2",
"size": (420mm, 594mm),
"body-size": 20pt,
"heading-size": 31pt,
"title-size": 47pt,
"subtitle-size": 38pt,
"authors-size": 31pt,
"keywords-size": 25pt,
)
#let layout-a3 = _default-layout + (
"paper": "a3",
"size": (297mm, 420mm),
"body-size": 14pt,
"heading-size": 22pt,
"title-size": 32pt,
"subtitle-size": 26pt,
"authors-size": 22pt,
"keywords-size": 18pt,
)
#let layout-a4 = _default-layout + (
"paper": "a4",
"size": (210mm, 297mm),
"body-size": 8pt,
"heading-size": 12pt,
"title-size": 18pt,
"subtitle-size": 15pt,
"authors-size": 12pt,
"keywords-size": 10pt,
)
/// The default layout is for an a0 poster
#let _state-poster-layout = state("poster-layout", layout-a0)
#let update-poster-layout(..args) = {
for (arg, val) in args.named() {
_state-poster-layout.update(pt => {
pt.insert(arg, val)
pt
})
}
}
#let set-poster-layout(layout) = {
// TODO match for strings such as "a0" "layout-a0" and so on
_state-poster-layout.update(pt => {
pt=layout
pt
})
}
#let poster-layout(layout: layout-a0, ..args, body) = {
// Define page size
set page(paper: args.named().at("paper", default: layout.at("paper", default: layout-a0.at("paper"))))
// Set default text size
set text(size: args.named().at("body-size", default: layout.at("body-size", default: layout-a0.at("spacing"))))
// Set spacing between blocks.
// We also want to adjust the gutter between columns
set block(spacing: args.named().at("spacing", default: layout.at("spacing", default: layout-a0.at("spacing"))))
set columns(gutter: args.named().at("spacing", default: layout.at("spacing", default: layout-a0.at("spacing"))))
set-poster-layout(layout)
update-poster-layout(..args)
body
}
// TEMPLATES
// See https://typst.app/docs/tutorial/making-a-template/
#let a0-poster(doc) = [
#set page("a0", margin: 1cm)
#set text(font: "Arial", size: layout-a0.at("body-size"))
#let box-spacing = 1.2em
#set columns(gutter: box-spacing)
#set block(spacing: box-spacing)
#set-poster-layout(layout-a0)
#update-poster-layout(spacing: box-spacing)
#doc
]
#let a1-poster(doc) = [
#set page("a1", margin: 1cm)
#set text(font: "Arial", size: layout-a1.at("body-size"))
#let box-spacing = 1.2em
#set columns(gutter: box-spacing)
#set block(spacing: box-spacing)
#set-poster-layout(layout-a1)
#update-poster-layout(spacing: box-spacing)
#doc
]
#let a2-poster(doc) = [
#set page("a2", margin: 1cm)
#set text(font: "Arial", size: layout-a2.at("body-size"))
#let box-spacing = 1.2em
#set columns(gutter: box-spacing)
#set block(spacing: box-spacing)
#set-poster-layout(layout-a2)
#update-poster-layout(spacing: box-spacing)
#doc
]
#let a3-poster(doc) = [
#set page("a3", margin: 1cm)
#set text(font: "Arial", size: layout-a3.at("body-size"))
#let box-spacing = 1.2em
#set columns(gutter: box-spacing)
#set block(spacing: box-spacing)
#set-poster-layout(layout-a3)
#update-poster-layout(spacing: box-spacing)
#doc
]
#let a4-poster(doc) = [
#set page("a4", margin: 1cm)
#set text(font: "Arial", size: layout-a4.at("body-size"))
#let box-spacing = 1.2em
#set columns(gutter: box-spacing)
#set block(spacing: box-spacing)
#set-poster-layout(layout-a4)
#update-poster-layout(spacing: box-spacing)
#doc
]