-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpresentation.typ
More file actions
772 lines (655 loc) · 16 KB
/
presentation.typ
File metadata and controls
772 lines (655 loc) · 16 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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
#import "@preview/polylux:0.3.1": *
#import "@preview/cetz:0.3.1"
#import "@preview/unify:0.6.0": num, qty, numrange, qtyrange
#import "@preview/ccicons:1.0.0": *
#import themes.metropolis: *
#show: metropolis-theme.with(
footer: context {
let current-page = here().page()
set text(size: 12pt)
query(<custom-footnote>)
.filter(it => it.location().page() == current-page)
.map(md => md.value)
.join(linebreak())
},
)
#let custom-footnote(it) = [
#metadata(it) <custom-footnote>
]
#show link: underline
#set text(
font: "Hanken Grotesk",
size: 20pt,
)
#let new-section-slide(name) = {
let content = {
utils.register-section(name)
set align(horizon)
show: pad.with(20%)
set text(size: 1.5em)
name
v(0.5em)
block(height: 2pt, width: 100%, spacing: 0pt, m-progress-bar)
}
logic.polylux-slide(content)
}
#let center-vertically(height: 1fr, it) = block(
height: height,
{
v(1fr)
it
v(1fr)
},
)
#let identity(x) = x
#let centered(it) = align(center, block(align(left, it)))
#let example(code, columns: (1fr, 1fr), show-output: identity) = {
show grid.cell: centered
grid(
columns: columns,
gutter: 1em,
raw(lang: "typ", block: true, code.text),
rect(
fill: gray.lighten(50%),
radius: 2.5mm,
inset: 2.5mm,
rect(
fill: white,
inset: 7.5mm,
show-output(eval(code.text, mode: "markup")),
),
),
)
}
#title-slide(
title: [Typst],
subtitle: [The Modern Alternative to LaTeX #cc #cc-zero],
author: [Maximilian Schmidt],
)
#slide(title: [Outline])[
#h(2em)#box[#metropolis-outline]
]
#new-section-slide[What is Typst?]
#slide(title: [What is Typst?])[
#set align(center + horizon)
#align(center)[
"Typst is a new markup-based typesetting system for the sciences."
]
#v(2em)
#grid(
columns: 2,
gutter: 2em,
align(
center + horizon,
{
block(
clip: true,
radius: 10pt,
width: 7em,
image("./assets/typst_logo.png"),
)
custom-footnote[Logo: https://avatars.githubusercontent.com/u/67595261?s=200&v=4]
},
),
[
#set align(left)
- /taɪpst/ i.e. 'Ty' like in Typesetting
- alternative to LaTeX, Word, or Google Docs
- built to be a pleasure to use
- powerful and easy to learn
- blazingly fast compile times
- free and Open Source (Apache 2.0)
],
)
]
#slide(title: [When to use Typst?])[
#grid(
columns: (1.5fr, 2fr),
align(
center,
{
place(
center + horizon,
image(
"./assets/towards-swifter-interstellar-mail-delivery_drop-shadowed.png",
height: 110%,
),
)
custom-footnote[Image: https://typst.app/assets/images/ieee.webp]
},
),
align(
center,
box[
#set align(left)
- markup for typesetting documents
- composing
- papers
- reports
- theses
- articles
- books
- presentations
- ...
- takes text files and outputs PDFs
],
),
)
]
#slide(title: [Why use Typst?])[
Why should I use typst instead of
#set list(indent: 1em)
#block(inset: (left: 2em))[
Word:
- easy collaboration
- powerful templates that automatically format your work
- higher-quality typographical output
LaTeX:
- instant previews
- clear and understandable error messages
- familiar programming constructs
]
]
#new-section-slide[How to use Typst?]
#slide(title: [Using the Web App])[
#figure(
{
image("./assets/web-app.png")
custom-footnote[Image: https://typst.app/assets/videos/mockup.webm]
},
supplement: none,
caption: [https://typst.app],
)
]
#slide(title: [Using Tinymist in VSCode])[
#set align(center)
#image("./assets/vscode.png", height: 120%)
#custom-footnote[Image: screenshot]
]
#slide(title: [Using the Command Line Interface])[
#set block(above: 1em, below: 1em)
#v(-1em)
- Download the latest release from GitHub, and update with
```sh
typst update
```
- Through package managers:
```sh
brew install typst
```
```sh
winget install --id Typst.Typst
```
- With a Rust toolchain:
```sh
cargo install --locked typst-cli
```
#v(1.5em)
and then use
```sh
typst watch document.typ
```
]
#slide(title: [How can it be free?])[
#v(1em)
- it is Open Source, and it will stay that way
- WebApp has subscription plans with additional features
- typst on-premises: self-hosted version for organizations
- commercial support contracts
#v(0.5em)
#align(
center + bottom,
image("./assets/typst-pro-transparent.png", height: 8em),
)
#custom-footnote[Image: screenshot of https://typst.app/pricing/]
]
#focus-slide[
#set text(size: 50pt)
Installation and Setup
#set text(size: 20pt)
#set align(top)
#show heading: set block(below: 1em)
#v(-1em)
#table(
columns: (2fr, 3fr),
inset: (x: 1.4em, y: 1.3em),
stroke: (x, y) => (
left: if x > 0 { 0.8pt + white },
top: if y > 0 { 0.8pt + white },
),
[
== WebApp
+ Sign up and Log in
+ Create document
https://typst.app
],
table.cell(
rowspan: 2,
[
== Local Installation
#set align(left)
Install the latest release:
- download binary from GitHub
- `brew install typst`
- `cargo install --locked typst-cli`
- `winget install --id Typst.Typst`
],
),
[
== VSCode
Install Extension: Tinymist
],
)
]
#new-section-slide[Typst Basics]
#slide(title: [Typst Basics])[
#example(```typ
When you begin typing words into a document, those words are automatically arranged into a visually coherent form known as typeset text.
```)
]
#slide(title: [Headers])[
#example(```typ
= Introduction
When you begin typing words into a document, those words are automatically arranged into a visually coherent form known as typeset text.
```)
]
#slide(title: [Markup])[
#example(```typ
Okay, let's move to _emphasis_ and *bold* text.
Markup syntax is generally similar to `AsciiDoc` (this was `raw` for monospace text!)
... and even "smart quotes" :)
```)
]
#slide(title: [Newlines])[
#example(```typ
You can break \
lines anywhere you \
want using the \\ symbol.
```)
]
#slide(title: [Lists])[
#example(```typ
+ First
+ Second
+ Third
- First
- First indented
- Second
- Third
- Third indented
- even more
```)
]
#slide(title: [Mathematical Expressions])[
#example(```typ
$Q = rho A v + C / 2$
```)
]
#slide(title: [Mathematical Expressions])[
#example(```typ
$
7.32 beta +
sum_(i=0)^nabla
(Q_i (a_i - epsilon)) / 2
$
```)
]
#focus-slide[
= Test it yourself!
#v(2em)
#set text(size: 24pt)
#grid(
columns: 2,
gutter: 4em,
[
#set align(left)
- Headers
- Italic/Bold
- Code (`raw`)
- Smart Quotes
],
[
#set align(left)
- Newlines
- Lists
- Enumerations
- Math
],
)
]
#new-section-slide[Typst Advanced]
#slide(title: [Scripting Mode])[
#v(-1em)
*Typst is a programming language!*
You can assign variables, define functions, work with lists or dictionaries, use loops ...
To differentiate code and content, Typst has a separate _scripting mode_.
#center-vertically(
example(```typ
// This is regular content
Hello World!
// This is math
$a^2 + b^2 = c^2$
// This is a function call
#lorem(5)
```),
)
]
#slide(title: [Code and Content Blocks])[
#example(```typ
#{
let radius = 2
let circumference(radius) = {
2 * calc.pi * radius
}
let result = circumference(radius)
[Result: #result]
}
```)
]
#slide(title: [Arguments])[
#example(```typ
Find the documentation here: #link(
"https://typst.app/docs/reference/",
[Official Reference]
).
#quote(
block: true,
attribution: "GitHub Copilot",
[
The documentation is a great
resource for learning Typst.
]
)
```)
]
#focus-slide[
= Script it yourself!
#v(2em)
#set text(size: 24pt)
#grid(
columns: 2,
gutter: 4em,
[
#set align(left)
- Content Mode
- Math Mode
- Script Mode
],
[
#set align(left)
- Code Blocks
- Functions
- Arguments
],
)
]
#new-section-slide[Build your own Paper]
#slide(title: [Set Rules])[
#example(```typ
Hello!
#set text(font: "DejaVu Sans Mono")
Hello!
#[
#set text(fill: red)
Hello!
]
#set text(size: 10pt)
Hello!
```)
]
#slide(title: [Show Rules])[
#example(```typ
https://typst.app
#show link: strong
https://typst.app
#show link: set text(fill: red)
https://typst.app
#show "km2": $"km"^2$
200km2
```)
]
#slide(title: [Typst Universe])[
#align(
center + horizon,
image("./assets/universe_drop-shadowed.png", height: 120%),
)
#custom-footnote[Image: screenshot of https://typst.app/universe/search/?kind=templates]
]
#slide(title: [Templates])[
#set align(center)
#grid(
columns: 2,
gutter: 3em,
[
#set align(left)
== WebApp
#v(0.5em)
#block(inset: (left: 1em))[
Click "Create Project in app"
]
#v(0.5em)
== Local
#v(0.5em)
#block(inset: (left: 1em))[
```bash
typst init @preview/charged-ieee:0.1.3
```
]
],
[
#image("./assets/poster_drop-shadowed.png", height: 110%)
#custom-footnote[Image: https://collaborating.tuhh.de/es/ce/public/tuhh-typst]
],
)
]
#slide(title: [Figures, Captions, and References])[
#example(```typ
Rivers as shown in @rivers are an important part of the earth's climate system.
#figure(
image(
"./assets/rivers.jpg",
width: 70%
),
caption: [
_River_ in a forest.
],
) <rivers>
```)
]
#slide(title: [Bibliography])[
#example(
show-output: it => {
set text(size: 12pt)
it
},
```typ
This is a citation to a paper by @johnson2022ai. Followed by a work of John Smith @smith2023modern.
#bibliography("literature.yaml")
```,
)
]
#slide(title: [... and so much more])[
#block(
breakable: false,
grid(
columns: (1fr, 1fr),
[
=== Tables
#block(inset: (left: 1em))[
#set text(size: 14pt)
#table(
columns: (auto, auto, auto),
inset: 10pt,
align: horizon,
table.header(
[],
[*Area*],
[*Parameters*],
),
[🚗],
$ pi h (D^2 - d^2) / 4 $,
[
#set align(center)
$h$, $D$, $d$
],
)]
=== Code blocks
#block(inset: (left: 1em))[
```python
def f(x):
return x**2
```
]
=== Units
#block(inset: (left: 1em))[
$qty("1.3+1.2-0.3e3", "erg/cm^2/s", space: "#h(2mm)")$
]
=== Symbols
#v(1.5em)
#block(inset: (left: 1em))[
#sym.arrow.r #sym.gt.eq #emoji.face.halo
]
],
[
=== Drawings
#block(inset: (left: 1em))[
#set text(size: 10pt)
#cetz.canvas(
length: 3cm,
{
import cetz.draw: *
scale(x: 0.5, y: 0.5)
set-style(
mark: (fill: black, scale: 2),
stroke: (thickness: 0.4pt, cap: "round"),
angle: (
radius: 0.3,
label-radius: .22,
fill: green.lighten(80%),
stroke: (paint: green.darken(50%)),
),
content: (padding: 1pt),
)
grid((-1.5, -1.5), (1.4, 1.4), step: 0.5, stroke: gray + 0.2pt)
circle((0, 0), radius: 1)
line((-1.5, 0), (1.5, 0), mark: (end: "stealth"))
content((), $ x $, anchor: "west")
line((0, -1.5), (0, 1.5), mark: (end: "stealth"))
content((), $ y $, anchor: "south")
for (x, ct) in ((-1, $ -1 $), (-0.5, $ -1 / 2 $), (1, $ 1 $)) {
line((x, 3pt), (x, -3pt))
content((), anchor: "north", ct)
}
for (y, ct) in (
(-1, $ -1 $),
(-0.5, $ -1 / 2 $),
(0.5, $ 1 / 2 $),
(1, $ 1 $),
) {
line((3pt, y), (-3pt, y))
content((), anchor: "east", ct)
}
// Draw the green angle
cetz.angle.angle(
(0, 0),
(1, 0),
(1, calc.tan(30deg)),
label: text(green, [#sym.alpha]),
)
line((0, 0), (1, calc.tan(30deg)))
set-style(stroke: (thickness: 1.2pt))
line(
(30deg, 1),
((), "|-", (0, 0)),
stroke: (paint: red),
name: "sin",
)
content(("sin.start", 50%, "sin.end"), text(red)[$ sin alpha $])
line("sin.end", (0, 0), stroke: (paint: blue), name: "cos")
content(
("cos.start", 50%, "cos.end"),
text(blue)[$ cos alpha $],
anchor: "north",
)
line(
(1, 0),
(1, calc.tan(30deg)),
name: "tan",
stroke: (paint: orange),
)
content(
"tan.end",
$
text(#orange, tan alpha) = text(#red, sin alpha) / text(#blue, cos alpha)
$,
anchor: "west",
)
},
)
]
=== Plots
#block(inset: (left: 1em))[
#cetz.canvas({
import cetz.draw: *
// Set up the transformation matrix
set-transform(
cetz.matrix.transform-rotate-dir((1, 1, -1.3), (0, 1, .3)),
)
scale(x: 1, z: -0.666)
grid((0, -2), (8, 2), stroke: gray + .5pt)
// Draw a sine wave on the xy plane
let wave(
amplitude: 1,
fill: none,
phases: 2,
scale: 8,
samples: 100,
) = {
line(
..(
for x in range(0, samples + 1) {
let x = x / samples
let p = (2 * phases * calc.pi) * x
((x * scale, calc.sin(p) * amplitude),)
}
),
fill: fill,
)
let subdivs = 8
for phase in range(0, phases) {
let x = phase / phases
for div in range(1, subdivs + 1) {
let p = 2 * calc.pi * (div / subdivs)
let y = calc.sin(p) * amplitude
let x = x * scale + div / subdivs * scale / phases
line((x, 0), (x, y), stroke: rgb(0, 0, 0, 150) + .5pt)
}
}
}
group({
rotate(x: 90deg)
wave(amplitude: 1.6, fill: rgb(0, 0, 255, 50))
})
wave(amplitude: 1, fill: rgb(255, 0, 0, 50))
})]
=== ...and much more
],
),
)
]
#slide(title: [Useful Links])[
#block(breakable: false)[
https://typst.app
https://typst.app/docs
https://sitandr.github.io/typst-examples-book/book/
https://typst.app/universe/
https://discord.gg/2uDybryKPe
https://github.com/qjcg/awesome-typst
https://collaborating.tuhh.de/es/ce/public/tuhh-typst
https://collaborating.tuhh.de/es/ce/public/templatesforreports
https://collaborating.tuhh.de/es/ce/public/ies-typst-phd-thesis-template
]
]
#focus-slide[
Feedback, Questions, and Ideas for Improvement?
]