-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtemplate.typ
109 lines (94 loc) · 2.42 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
#let scriptsize = 8pt
#let transition(
// The slide accent color. Default is a vibrant yellow.
accent-color: rgb("f3bc54"),
// The slide content.
body,
) = {
page(
width: 15cm,
height: 10cm,
background: rect(width: 100%, height: 100%, fill: accent-color),
header: none,
footer: none,
)[
#set align(center+horizon)
#set text(28pt, fill: white, weight: "bold")
#body
]
}
#let diapo(
// The presentation's title, which is displayed on the title slide.
title: [Title],
// The presentation's author, which is displayed on the title slide.
author: none,
// The date, displayed on the title slide.
date: none,
// If true, display the total number of slide of the presentation.
display-lastpage: true,
// If set, this will be displayed on top of each slide.
short-title: none,
// The presentation's content.
body
) = {
// Ensure that the type of `author` is an array
author = if type(author) == "string" { ((name: author),) }
else if type(author) == "array" { author }
else { panic("expected string or array, found " + type(author)) }
// Set the metadata.
set document(title: title, author: author.map(author => author.name))
// Configure page and text properties.
set text(font: "PT Sans", weight: "regular")
set page(
width: 15cm,
height: 10cm,
header: if short-title != none {
set align(right)
set text(size: scriptsize)
short-title
},
footer: [
#let lastpage-number = locate(pos => counter(page).final(pos).at(0))
#set align(right)
#text(size: scriptsize)[
*#counter(page).display("1")*
#if (display-lastpage) [\/ #lastpage-number]
]
],
)
// Display the title page.
page(background: none, header: none, footer: none)[
#set align(center+horizon)
#set text(24pt, weight: "light")
#title
#set text(14pt)
#let count = author.len()
#let ncols = calc.min(count, 3)
#grid(
columns: (auto,) * ncols,
column-gutter: 16pt,
row-gutter: 24pt,
..author.map(author => {
author.name
if (author.keys().contains("affiliation")) {
linebreak()
author.affiliation
}
if (author.keys().contains("email")) {
linebreak()
link("mailto:" + author.email)
}
}),
)
#text(features: ("case",))[#date]
]
// Customize headings to show new slides.
show heading: set text(font: ("Avenir", "Inter Display", "Inter", "Arial"))
show heading.where(level: 1): it => {
pagebreak()
align(top, it)
v(1em)
}
// Add the body.
body
}