ioslides is one of the presentation format that can be easily put together using R Markdown.
It has good compatibility with html, and very easy set-up.
5/25/2021
ioslides is one of the presentation format that can be easily put together using R Markdown.
It has good compatibility with html, and very easy set-up.
Similar to R Markdown for html_documents, ioslides_presentation also requires a YAML setting in the begining of the rmd. Some of the features can be specified like:
output:
| ioslides_presentation:
| incremental: true
(render bullets incrementallly throughout the slides)
| widescreen: true
(present slide using wider form)
| smaller: true
(use smaller text size throughout the slides)
| transition: default, slower, faster, 0.5
(choose transition speed, or specify how many seconds)
| logo: logo.png
(set a logo with the size of 85 * 85 )
Similar to documents, headers have levels and is specified by #
, ##
or ###
.
Bullet point can be achieved by entering text after -
.
> -
using > * for the first line, and >tab* for the following lines
{.build}
after the header (see the presenting slide for example).|
character (see the add plot slide for example).A smaller text size can be achieved by adding {.smaller}
after the header (this slide used smaller text size).
page break is achieved by entering three hyphens ---
.
While using browser to open and present ioslides, one can alter display modes by tapping:
f
: fullscreen mode
w
: widescreen mode
o
: overview mode
h
: code highlight mode
p
: presenter notes
Adding a plot to ioslides is rather similar to that html document.
## Warning: Removed 3 rows containing missing values (geom_point).
scatter plot
Background color can be achieved by adding {data-background=#00B9E3}
after the header.
Background image can be achieved by adding {data-background=lake.jpg data-background-size=cover}
after the header.
Most of the code-chunk specifications in the regular document RMD can be used in the presentation RMD.
## # A tibble: 2 x 2 ## Employed n ## * <chr> <int> ## 1 No 74 ## 2 Yes 26
To highlight a set of code chunks (bold the code), use a special highlight comment around the code.
### <b>
code
### </b>
For example:
PseudoData %>% count(Employed)
Tables can be added in a variety of ways, like kable, reactable, and such.
Here we use a tbl_summary (library: gtsummary) created summary table as an example.
Variable | N | Overall, N = 1001 | No, N = 741 | Yes, N = 261 |
---|---|---|---|---|
Grade_Math_Y1 | 98 | 70 (62, 76) | 69 (62, 74) | 75 (70, 82) |
Unknown | 2 | 1 | 1 | |
Gender | 100 | |||
Female | 65 (65%) | 48 (65%) | 17 (65%) | |
Male | 35 (35%) | 26 (35%) | 9 (35%) | |
1
Median (IQR) or Frequency (%)
|
You can center content vertically for the whole slide by adding {.flexbox .vcenter}
to the header.
You can also center certain content horizontally by specifying the following
<dev class="centered">
This whole section is centered
</div>
A two-column layout can be done by wrapping two chunks of codes with a specific class. See the following for example.
<div class="columns-2">
plot code
text code
</div>
Bold text can be achieved by **Bold**
.
Italic text can be achieved by *Italic*
Color text can be achieved by:
<div class="red2">
Color text
</div>
The way of adding notes to a slide is included in the note of this slide.
Most of the feature that html_document has also applies to ioslide_presentation, for example: figure options, data frame printing, document dependencies, header and before/after body inclusions, math equations and such.
If need to convert to pdf, the best way is to open the ioslide in chrome, then print as pdf.
Each of the other presentation format has its own style, unique utility and slide different coding convention.
slidy: for example, allows showing table of content in display mode, allows adding footer, and adding countdown timer.
beamer: for example, allows pre-defined color/font themes, and slide levels.
powerpoint: for example, is one of the most widely used presentation format, similar to docx format, which is also from Microsoft, allows loading custom templates.