knitr::opts_chunk$set(echo = FALSE)

Slide using boxes

IOSlides plus (iosp) extends ioslides_presentation and allows to create columns or boxes as level 3 headers.

Box 1{.box-4 .bg-red}

Test 1

Box 2{.box-6 .bg-green}

Box 3{.box-6 .bg-blue}

This box has again a width of 6 col and wraps to a new line.

%end%

We are able to exit the box using the keyword %end%.

Box without title bar

Box with title {.box-6 .bg-blue}

A box can have a title

{.box-6 .bg-blue}

Or not...

%end%

Align boxes

Box 1{.box-4 .bg-red}

A smaller box

Box 2{.box-4 .bg-red}

A bigger box

Box 3{.box-4 .bg-red}

An intermediate one...

%end%

You can use the stretch class to tretch the height to the row height.

Box 1{.box-4 .bg-red .stretch}

A smaller box

Box 2{.box-4 .bg-red .stretch}

A bigger box

Box 3{.box-4 .bg-red .stretch}

An intermediate one...

Align boxes | continued...

You can also use the bottom class

Box 1{.box-4 .bg-red .bottom}

A smaller box

Box 2{.box-4 .bg-red .bottom}

A bigger box

Box 3{.box-4 .bg-red .bottom}

An intermediate one...

%end%

Or the middle class

Box 1{.box-4 .bg-red .middle}

A smaller box

Box 2{.box-4 .bg-red .middle}

A bigger box

Box 3{.box-4 .bg-red .middle}

An intermediate one...

Align boxes | continued...

You can also mix the classes

bottom{.box-3 .bg-red .bottom}

top {.box-3 .bg-red}

middle{.box-3 .bg-red .middle}

stretch{.box-3 .bg-red .stretch}

Offsetting boxes

You can add an offset on the left side of a box using the offset-x class where $1 \leq x \leq 11$

Box{.box-4 .bg-red}

Test

Box{.box-4 .offset-4 .bg-red}

Test

Box{.box-2 .offset-2 .bg-red}

Test

Box{.box-8 .bg-red}

Test

{.box-1 .offset-11 .bg-blue}

A

{.box-1 .bg-blue}

B

Blockquotes

You can specify the author of a citation using |

This is a citation | author

It is possible to change the background colour by using a box colour class

This is a citation with a red background | author{.bg-red}

Blockquotes accept width and offset settings

This is a citation with a yellow background | author{.bg-yellow .col-4 .offset-4}

Image size

{.col-6}

plot(cars)

Images in a column are adjusted to the column width (or height). On the right side, when using the nofit class, the image is not resized and might not fit in the column.

{.col-6 .nofit}

plot(cars)

Code chunks

Base code chunks

x <- 1:10
x * 2
x * 3

With eval = FALSE

x <- 1:10
x * 2
x * 3

With echo = FALSE

x <- 1:10
x * 2
x * 3

Display chunks by row{.smaller}

You can use the row chunk option to display the source and results side by side. Set row = TRUE:

x <- 1:10
x * 2
x * 3

You can also set the width of each columns in a vector (sum < 12)

x <- 1:10
x * 2
x * 3

Setting the collapse = TRUE option will merge the rows:

x <- 1:10
x * 2
x * 3

Chunks generating plots

# This is a comment
plot(cars)

Chunks generating plots | side by side

# This is a comment
plot(cars)

Chunks in a column or box layout{.smaller}

Box {.box-4 .bg-red .stretch}

This is a red box

{.col-8}

x <- 1:10
x * 2
x * 3

%end%

Code chunks can be placed in a column to restrict the width. Alternatively, the width chunk option can be adjusted.

x <- 1:10
x * 2
x * 3

{.col-6}

plot(cars)

Column layout{.column}

First box {.box-6 .bg-red}

Instead of populating boxes and columns by row, it is possible to arrange them by columns using the column class in the level 2 header.

This is a first box containing multiple elements

Second box {.box-6 .bg-yellow}

Smaller box which will appear in a new column as soon as the first is full.

Third box {.box-6 .bg-green}

...

Slide background colour and vertical center{.middle .slide-bg-cobalt}

Centered box {.box-6 .offset-3 .bg-yellow}

This box will appear in the middle of the slide.



koncina/iosp documentation built on Nov. 23, 2020, 7:23 p.m.