-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpresentation.template.typ
More file actions
245 lines (189 loc) · 5.69 KB
/
presentation.template.typ
File metadata and controls
245 lines (189 loc) · 5.69 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
// NumPEx Presentation Template for Typst
// Equivalent to presentation.template.tex
#import "numpex.typ": *
#show: numpex-theme.with(
title: "A new presentation theme for NumPEx",
short-title: "NumPEx Theme",
author: "Christophe Prud'homme",
short-author: "C. Prud'homme",
date: datetime.today().display("[month repr:long] [day], [year]"),
institution: "Institute or miscellaneous information",
aspect-ratio: "16-9",
)
// ============================================================================
// Title Slide
// ============================================================================
#title-slide(
title: "A new presentation theme for NumPEx",
subtitle: "This is a subtitle",
author: "Christophe Prud'homme",
date: datetime.today().display("[month repr:long] [day], [year]"),
institution: "Institute or miscellaneous information",
)
// ============================================================================
// Introduction
// ============================================================================
#slide(title: "NumPEx theme")[
The NumPEx theme is a Beamer theme with minimal visual noise inspired by the
#align(center)[
#alert[#link("https://www.info.gouv.fr/marque-de-letat")[Charte graphique de l'etat Français]]
]
Enable the theme by loading
#v(-0.2em)
#raw("\usetheme{numpex}", block: true, lang: "latex")
#v(-0.2em)
Note, that you have to have _Marianne_ font and XeTeX. Install it to enjoy this wonderful typography. You can find the font
#align(center)[
#alert[#link("https://www.systeme-de-design.gouv.fr/elements-d-interface/fondamentaux-de-l-identite-de-l-etat/typographie/")[here]]
]
]
#slide(title: "Sections")[
Sections group slides of the same topic. Use the section-slide function:
```typst
#section-slide("Elements")
```
which creates a full-page section break with the NumPEx styling...
]
// ============================================================================
// Section: Elements
// ============================================================================
#section-slide("Elements")
#slide(title: "Typography")[
The theme provides sensible defaults to _emphasize_
text, #alert[accent] parts or show *bold* results.
#v(1em)
- Regular text appears in Marianne font (or fallback)
- #alert[Alerted text] uses the French red color
- _Emphasized text_ is italicized
- *Bold text* for strong emphasis
]
#slide(title: "Lists")[
#grid(
columns: (1fr, 1fr),
gutter: 2em,
[
*Items*
- Milk
- Eggs
- Potatoes
],
[
*Enumerations*
+ First,
+ Second and
+ Last.
],
)
]
#slide(title: "Descriptions")[
#set terms(separator: [ --- ])
/ PowerPoint: Meeh.
/ Beamer: Yeeeha.
/ Typst: Even better!
]
#slide(title: "Tables")[
#figure(
caption: [Largest cities in the world (source: Wikipedia)],
table(
columns: 2,
align: (left, right),
table.hline(stroke: 1.5pt),
table.header([*City*], [*Population*]),
table.hline(stroke: 0.5pt),
[Mexico City], [20,116,842],
[Shanghai], [19,210,000],
[Peking], [15,796,450],
[Istanbul], [14,160,467],
table.hline(stroke: 1.5pt),
),
)
]
#slide(title: "Blocks")[
#block(title: "This is a block title")[
Hello
]
#example-block(title: "This is an example block")[
Hello
]
]
#slide(title: "Math")[
Euler's limit definition of $e$:
$ e = lim_(n -> infinity) (1 + 1/n)^n $
#v(1em)
And the famous identity:
$ e^(i pi) + 1 = 0 $
]
#slide(title: "Line plots")[
#import "@preview/cetz:0.3.4": canvas, draw
#align(center)[
#canvas(length: 0.8cm, {
import draw: *
// Grid
for x in range(0, 5) {
line((x, -1), (x, 4), stroke: gray + 0.3pt)
}
for y in range(-1, 5) {
line((0, y), (4, y), stroke: gray + 0.3pt)
}
// Axes
line((-0.2, 0), (4.2, 0), mark: (end: ">"), stroke: black)
line((0, -1.2), (0, 4.2), mark: (end: ">"), stroke: black)
content((4.4, 0), $x$)
content((0, 4.5), $f(x)$)
// f(x) = x (red)
line((0, 0), (3.5, 3.5), stroke: red)
content((3.8, 3.5), $f(x) = x$, anchor: "west")
// f(x) = sin(x) approximation (blue)
let sin-points = ()
for i in range(0, 40) {
let x = i * 0.1
let y = calc.sin(x)
sin-points.push((x, y))
}
line(..sin-points, stroke: blue)
content((4.2, 0.7), $f(x) = sin x$, anchor: "west")
// f(x) = exp(x)/20 (orange)
let exp-points = ()
for i in range(0, 35) {
let x = i * 0.1
let y = 0.05 * calc.exp(x)
exp-points.push((x, y))
}
line(..exp-points, stroke: orange)
content((3.8, 1.7), $f(x) = 1/20 e^x$, anchor: "west")
})
]
]
#slide(title: "Code")[
I love Fortran!
#v(0.5cm)
```fortran
program pippo
integer, parameter :: m=10, n=5
real(kind(1.d0)), allocatable :: a(:,:)
allocate(a(m,n)) ! allocate the matrix
call random_number(a) ! fill it up
call do_something(a) ! do something on it
write(*,'("Hello world")')
stop
end program pippo
```
]
// ============================================================================
// Section: Conclusion
// ============================================================================
#section-slide("Conclusion")
#slide(title: "Summary")[
Get the source of this theme and the demo presentation from
#v(1em)
#align(center)[
#link("https://github.com/numpex/presentation.template/")
]
#v(1em)
*Typst advantages:*
- Much faster compilation (sub-second)
- Cleaner syntax
- Built-in package manager
- Hot reloading with `typst watch`
]
#plain-slide(title: "Questions?")