-
Notifications
You must be signed in to change notification settings - Fork 3
/
slideshow.qmd
396 lines (275 loc) · 9.59 KB
/
slideshow.qmd
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
---
title: "Exercise: Creating a slideshow with Quarto"
lang: en
---
## Description
Pick a previous slideshow of yours and try to recreate it using Quarto. The following slideshow incorporates all features from this exercise. You can download it at the end of this page.
```{=html}
<iframe class="slide-deck" width="100%" height="450" src="demo_slideshow.html"></iframe>
```
## Getting started
You can begin by creating a new Quarto Presentation.
1. Create a new Quarto Presentation
- Click on _File_ > _New File_ > _Quarto Presentation_
- Fill _Title_ and _Author_
- Click _Create_
2. Declare the language of the document by setting e.g. `lang: en` in the YAML header (see the [Quarto documentation on document language](https://quarto.org/docs/authoring/language.html) for more information)
3. Change `format` as follows:\
```yaml
format:
revealjs:
embed-resources: true
hash-one-based-index: true
slide-number: true
navigation-mode: "linear"
width: 1600
height: 900
```
4. Click on the disk symbol to save (maybe call the file `presentation.qmd`)
5. Click on _Render_
## Creating slides
Per default, level-1 and level-2 headings create new slides, but horizontal rules (`---`) work as well:
```md
# Slide 1
Content on first slide
# Slide 2
Content on second slide
---
Content on third slide
```
## Usage
- Navigate forward with {{< kbd Space >}} or {{< kbd N >}} (for **n**ext)^[The arrow keys {{< kbd → >}} and {{< kbd ↓ >}} are specifically for navigating through [vertical slides](https://quarto.org/docs/presentations/revealjs/advanced.html#vertical-slides).]
- Navigate backward with {{< kbd Shift+Space >}} or {{< kbd P >}} (for **p**revious)^[The arrow keys {{< kbd ← >}} and {{< kbd ↑ >}} are specifically for navigating through [vertical slides](https://quarto.org/docs/presentations/revealjs/advanced.html#vertical-slides).]
- Press {{< kbd F >}} to switch to **f**ullscreen
- Press {{< kbd O >}} or {{< kbd Esc >}} to show the slide **o**verview
- Press {{< kbd B >}} or {{< kbd . >}} to pause (**b**lacken) the screen
- Press {{< kbd G >}} to **g**o to any slide by number
- Press {{< kbd S >}} to open the **s**peaker notes
- Press {{< kbd M >}} to toggle a **m**enu that allows you to jump to any slide
- Press {{< kbd Ctrl >}} + click on the slide to zoom in
- Press {{< kbd Ctrl+Shift+F >}} to activate search
- Press {{< kbd ? >}} to show the keyboard help
## Slide layout
Elements (e.g., text, images) on a slide are typically arranged in the order they appear in the markdown source. There are multiple ways, however, to add more structure to a slide.
### Columns
One can create multiple columns next to each other by structuring them using Pandoc's fenced [divs](https://quarto.org/docs/authoring/markdown-basics.html#divs-and-spans) with the classes `columns` and `column`:
```md
::: {.columns}
:::: {.column width="33%"}
Left
::::
:::: {.column width="33%"}
Middle
::::
:::: {.column width="33%"}
Right
::::
:::
```
### Tabsets
Tabsets allow to put more content on a slide than the available space normally allows. Use a [div](https://quarto.org/docs/authoring/markdown-basics.html#divs-and-spans) with the class `panel-tabset`:
```md
::: {.panel-tabset}
### Tab A
Content for `Tab A`
### Tab B
Content for `Tab B`
:::
```
### Layouts
If the content on a slide is to be presented within two columns or two rows, one can set `layout-ncol` or `layout-nrow`:
```md
::: {layout-ncol=2}
Content in first column
Content in second column
:::
::: {layout-nrow=2}
Content in first row
Content in second row
:::
```
If the content of one column/row spans multiple paragraphs, one can nest it inside a div:
```md
::: {layout-ncol=2}
:::: {}
__Left__
![](image.png)
::::
:::: {}
__Right__
![](image.png)
::::
:::
```
The [Quarto documentation on figure panels](https://quarto.org/docs/authoring/figures.html#figure-panels) provides additional examples.
More complex layouts can be achieved by specifying `layout`:
```md
::: {layout="[[1,1], [1]]"}
Top left
Top right
Bottom
:::
```
You can read more about [panel layouts in the Quarto documentation](https://quarto.org/docs/interactive/layout.html#panel-layout).
### Callouts
Quarto provides pre-styled blocks in five different flavours that draw the reader's attention:
```md
::: {.callout-note}
Note that there are five types of callouts, including:
`note`, `warning`, `important`, `tip`, and `caution`.
:::
```
More information about callouts is provided in the [Quarto documentation on callouts](https://quarto.org/docs/authoring/callouts.html).
### Asides and footer
Asides contain less important content and are displayed at the bottom of a slide:
```md
::: {.aside}
Some additional commentary of more peripheral interest.
:::
```
A footer can be added on any slide by creating a [div](https://quarto.org/docs/authoring/markdown-basics.html#divs-and-spans) with the class `footer`:
```md
::: {.footer}
Custom footer
:::
```
## Positioning of elements
### Center content vertically
```md
## Centered slide {.center}
This will appear in the middle, rather than the top, of the slide.
```
### Absolute position
One can also specify the exact position of elements by using the class `absolute`:
```md
![](image.png){.absolute top="200" left="50" width="300"}
[Text at custom position]{.absolute top="400" left="600" width="300"}
```
### Fit words
You can fit words to the slide by adding the class `r-fit-text`:
```md
[Two Words]{.r-fit-text}
[Longer Explanation]{.r-fit-text}
```
### Border
One can add a border around any element by adding the class `r-frame`:
```md
[Other content]{.r-frame}
```
## Incremental points
For bullet points to appear step by step, use the following syntax:
```md
::: {.incremental}
- first point
- second point
- last point
:::
```
Other elements, such as columns, can be made incremental by adding the class `fragment`:
```md
::: {.columns}
:::: {.column width="40%"}
- foo
- bar
- baz
::::
:::: {.column width="60%" .fragment}
- foo
- bar
::::
:::
```
The same can be applied to images:
```md
::: {.fragment}
![](image.png){width=300px}
:::
```
## Interactivity
### Lightbox images
One can allow to open an enlarged version of images by adding the class `lightbox`:
```md
![](image.png){.lightbox}
```
### Videos
Interactive elements can be incorporated by embedding videos:
```md
{{{< video https://vimeo.com/1084537 width="640px" height="360px" >}}}
```
### R Code
R code may compute to interactive widgets:
``````qmd
```{{r}}
swiss |>
tibble::rownames_to_column(var = "Province") |>
gt::gt() |>
gt::opt_interactive(
use_search = TRUE,
use_filters = TRUE,
use_resizers = TRUE,
use_highlight = TRUE,
use_compact_mode = TRUE,
use_page_size_select = FALSE,
page_size_default = 5
)
```
``````
### Websites
As the slideshow is a website, other websites can be embedded, too:
``````md
::: {.columns}
:::: {.column}
Discover the elements that make up a neuron.
::::
:::: {.column}
```{{=html}}
<iframe class="r-frame" data-src="https://humanbiology.pressbooks.tru.ca/wp-admin/admin-ajax.php?action=h5p_embed&id=118" width="882" height="533" frameborder="0" allowfullscreen="allowfullscreen" data-external="1"></iframe><script src="https://humanbiology.pressbooks.tru.ca/wp-content/plugins/h5p/h5p-php-library/js/h5p-resizer.js" charset="UTF-8"></script>
```
::::
:::
``````
## Background
One can put colors, images, videos and whole websites in the background of a slide. E.g. for a aquamarine slide, one can do the following:
```md
# Aquamarine Slide {data-background-color="aquamarine"}
Some content
```
An image can be used as background like this:
```md
# {background-image="https://picsum.photos/1600/900"}
Content with background image
```
Note that one can also choose to use a GIF as image background and thus achieve a moving background. Alternatively one can show a video in the background of a slide like this:
```md
# {background-video="https://test-videos.co.uk/vids/sintel/mp4/av1/1080/Sintel_1080_10s_1MB.mp4"}
Content with video background
```
Finally, whole websites can be embedded into slideshows, such as this Google Streetview sight of the Buckingham Palace:
```md
# {background-iframe="https://www.google.com/maps/embed?pb=!4v1567634732542!6m8!1m7!1sCAoSK0FGMVFpcFBwdDA1a3pFdm9mWVk0Y3Z4dS1zX3JEUGVMT25ib0I3QnRqem8.!2m2!1d51.50178371216957!2d-0.1407569859987906!3f232.50377602784036!4f-2.7819907211537895!5f0.7820865974627469" background-interactive="true"}
```
## Speaker notes
Speaker notes can be added using a div with the class name `notes`:
```md
::: {.notes}
These are speaker notes that belong to the current slide.
:::
```
They appear while presenting the slideshow next to the slide's content.
## References
Put your bibliography in a BibTeX file (extension `.bib`) and reference it in your YAML metadata:
```yaml
bibliography: literature.bib
```
Add a level one heading and a div with the id `refs` at the end of the document:
```md
# References
::: {#refs}
:::
```
You can now cite from your bibliography using the syntax `[@id]`.
For more information on how to cite literature, head over to the [Quarto documentation on citations](https://quarto.org/docs/authoring/footnotes-and-citations.html).
## Final notes
For even more features like remote control, chalkboards, transitions, automatic progress, and link previews, head over to the [Quarto documentation on Reveal.js slides](https://quarto.org/docs/presentations/revealjs/).
You can download the source of a presentation that uses all the features presented on this page via the following button:
{{< downloadthis demo_slideshow.zip dname="demo_slideshow" label="Download source files as ZIP">}}