-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathlib.typ
86 lines (74 loc) · 1.99 KB
/
lib.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
// This theme is inspired by https://github.com/matze/mtheme
// The Polylux-port was originally performed by https://github.com/Enivex
#import "@preview/polylux:0.4.0": *
#let bright = rgb("#eb811b")
#let brighter = rgb("#d6c6b7")
#let slide-title-header = toolbox.next-heading(h => {
show: toolbox.full-width-block.with(fill: text.fill, inset: 1em)
set align(horizon)
set text(fill: page.fill, size: 1.2em)
strong(h)
})
#let the-footer(content) = {
set text(size: 0.8em)
show: pad.with(.5em)
set align(bottom)
context text(fill: text.fill.lighten(40%), content)
h(1fr)
toolbox.slide-number
}
#let outline = toolbox.all-sections((sections, _current) => {
enum(tight: false, ..sections)
})
#let progress-bar = toolbox.progress-ratio( ratio => {
set grid.cell(inset: (y: .03em))
grid(
columns: (ratio * 100%, 1fr),
grid.cell(fill: bright)[],
grid.cell(fill: brighter)[],
)
})
#let new-section(name) = slide({
set page(header: none, footer: none)
show: pad.with(20%)
set text(size: 1.5em)
name
toolbox.register-section(name)
progress-bar
})
#let focus(body) = context {
set page(header: none, footer: none, fill: text.fill, margin: 2em)
set text(fill: page.fill, size: 1.5em)
set align(center)
body
}
#let divider = line(length: 100%, stroke: .1em + bright)
#let setup(
footer: none,
text-font: "Fira Sans",
math-font: "Fira Math",
code-font: "Fira Code",
text-size: 23pt,
body,
) = {
set page(
paper: "presentation-16-9",
fill: white.darken(2%),
margin: (top: 3em, rest: 1em),
footer: the-footer(footer),
header: slide-title-header,
)
set text(
font: text-font,
// weight: "light", // looks nice but does not match Fira Math
size: text-size,
fill: rgb("#23373b"), // dark teal
)
set strong(delta: 100)
show math.equation: set text(font: math-font)
show raw: set text(font: code-font)
set align(horizon)
show emph: it => text(fill: bright, it.body)
show heading.where(level: 1): _ => none
body
}