Presentations with ioslides

To create an ioslides presentation from R Markdown you specify the ioslides_presentation output format in the front-matter of your document. You can create a slide show broken up into sections by using the # and ## heading tags (you can also create a new slide without a header using a horizontal rule ( ---- ). For example here’s a simple slide show:

You can add a subtitle to a slide or section by including text after the pipe (|) character. For example:

Display Modes

The following single character keyboard shortcuts enable alternate display modes:

'f' enable fullscreen mode

'w' toggle widescreen mode

'o' enable overview mode

'h' enable code highlight mode

'p' show presenter notes

Pressing Esc exits all of these modes. See the sections below on Code Highlighting and Presenter Mode for additional detail on those modes.

Incremental Bullets

You can render bullets incrementally by adding the incremental option:

If you want to render bullets incrementally for some slides but not others you can use this syntax:

Visual Appearance

Presentation size.

You can display the presentation using a wider form factor using the widescreen option. You can specify that smaller text be used with the smaller option. For example:

You can also enable the smaller option on a slide-by-slide basis by adding the .smaller attribute to the slide header:

Transition Speed

You can customize the speed of slide transitions using transition option. This can be “default”, “slower”, “faster”, or a numeric value with a number of seconds (e.g. 0.5) . For example:

Build Slides

Slides can also have a .build attribute that indicate that their content should be displayed incrementally. For example:

Slide attributes can be combined if you need to specify more than one, for example:

You can add your own CSS to an ioslides presentation using the css option:

You can also target specific slides or classes of slice with custom CSS by adding ids or classes to the slides headers within your document. For example the following slide header:

Would enable you to apply CSS to all of it’s content using either of the following CSS selectors:

Code Highlighting

It’s possible to select subsets of code for additional emphasis by adding a special “highlight” comment around the code. For example:

The highlighted region will be displayed with a bold font. When you want to help the audience focus exclusively on the highlighted region press the 'h' key and the rest of the code will fade away.

Adding a Logo

You can add a logo to the presentation using the logo option (by default, the logo will be displayed in a 85x85 pixel square). For example:

The logo graphic will be rescaled to 85x85 (if necessary) and added to the title slide. A smaller icon version of the logo will be included in the bottom-left footer of each slide.

The logo on the title page and the rectangular element containing it can be customised with CSS. For example:

These selectors are to be placed in the CSS text file.

Similarly, the logo in the footer of each slide can be resized to any desired size. For example:

This will make the footer logo 150 by 75 pixels in size.

The ioslides template has an attractive default style for tables so you shouldn’t hesitate to add tables for presenting more complex sets of information. Pandoc markdown supports several syntaxes for defining tables which are described in the pandoc markdown specification .

Advanced Layout

You can center content on a slide by adding the .flexbox and .vcenter attributes to the slide title. For example:

You can horizontally center content by enclosing it in a div tag with class centered . For example:

You can do a two-column layout using the columns-2 class. For example:

Note that content will flow across the columns so if you want to have an image on one side and text on the other you should make sure that the image has sufficient height to force the text to the other side of the slide.

You can color content using base color classes red, blue, green, yellow, and gray (or variations of them e.g. red2, red3, blue2, blue3, etc.). For example:

Presenter Mode

A separate presenter window can also be opened (ideal for when you are presenting on one screen but have another screen that’s private to you). The window stays in sync with the main presentation window and also shows presenter notes and a thumbnail of the next slide. To enable presenter mode add ?presentme=true to the URL of the presentation, for example:

The presenter mode window will open and will always re-open with the presentation until it’s disabled with:

To add presenter notes to a slide you include it within a “notes” div . For example:

Printing and PDF Output

You can print an ioslides presentation from within browsers that have good support for print CSS (i.e. as of this writing Google Chrome has the best support). Printing maintains most of the visual styles of the HTML version of the presentation.

To create a PDF version of a presentation you can use Print to PDF from Google Chrome.

Figure Options

There are a number of options that affect the output of figures within ioslides presentations:

fig_width and fig_height can be used to control the default figure width and height (7x5 is used by default)

fig_retina Specifies the scaling to perform for retina displays (defaults to 2, which currently works for all widely used retina displays). Note that this only takes effect if you are using knitr >= 1.5.21. Set to null to prevent retina scaling.

fig_caption controls whether figures are rendered with captions

dev controls the graphics device used to render figures (defaults to png)

For example:

Data Frame Printing

You can enhance the default display of data frames via the df_print option. Valid values include:

MathJax Equations

By default MathJax scripts are included in ioslides presentations for rendering LaTeX and MathML equations. You can use the mathjax option to control how MathJax is included:

Specify “default” to use an https URL from the official MathJax CDN.

Specify “local” to use a local version of MathJax (which is copied into the output directory). Note that when using “local” you also need to set the self_contained option to false.

Specify an alternate URL to load MathJax from another location.

Specify null to exclude MathJax entirely.

For example, to use a local copy of MathJax:

To use a self-hosted copy of MathJax:

To exclude MathJax entirely:

Document Dependencies

By default R Markdown produces standalone HTML files with no external dependencies, using data: URIs to incorporate the contents of linked scripts, stylesheets, images, and videos. This means you can share or publish the file just like you share Office documents or PDFs. If you’d rather have keep depenencies in external files you can specify self_contained: false . For example:

Note that even for self contained documents MathJax is still loaded externally (this is necessary because of it’s size). If you want to serve MathJax locally then you should specify mathjax: local and self_contained: false .

One common reason keep dependencies external is for serving R Markdown documents from a website (external dependencies can be cached separately by browsers leading to faster page load times). In the case of serving multiple R Markdown documents you may also want to consolidate dependent library files (e.g. Bootstrap, MathJax, etc.) into a single directory shared by multiple documents. You can use the lib_dir option to do this, for example:

Advanced Customization

Keeping markdown.

When knitr processes an R Markdown input file it creates a markdown (md) file which is subsequently tranformed into HTML by pandoc. If you want to keep a copy of the markdown file after rendering you can do so using the keep_md option:

You can do more advanced customization of output by including additional HTML content or by replacing the core pandoc template entirely. To include content in the document header or before/after the document body you use the includes option as follows:

Custom Templates

You can also replace the underlying pandoc template using the template option:

Consult the documentation on pandoc templates for additional details on templates. You can also study the default HTML template as an example.

The level of customisation that can be achieved is limited. The slides are generated by custom formatting written in Lua and as such the template used must include the string RENDERED_SLIDES as can be found in the file with path rmarkdown:::rmarkdown_system_file("rmd/ioslides/default.html") .

Markdown Extensions

By default R Markdown is defined as all pandoc markdown extensions with the following tweaks for backward compatibility with the markdown package:

You can enable or disable markdown extensions using the md_extensions option (you preface an option with - to disable and + to enable it). For example:

The above would disable the autolink_bare_uris extension and enable the hard_line_breaks extension.

For more on available markdown extensions see the pandoc markdown specification .

Pandoc Arguments

If there are pandoc features you want to use that lack equivilants in the YAML options described above you can still use them by passing custom pandoc_args . For example:

Documentation on all available pandoc arguments can be found in the pandoc user guide .

Shared Options

If you want to specify a set of default options to be shared by multiple documents within a directory you can include a file named _output.yaml within the directory. Note that no YAML delimeters or enclosing output object are used in this file. For example:

_output.yaml

All documents located in the same directory as _output.yaml will inherit its options. Options defined explicitly within documents will override those specified in the shared options file.

R-bloggers

R news and tutorials contributed by hundreds of R bloggers

Mastering r presentations.

Posted on September 23, 2019 by R on Coding Club UC3M in R bloggers | 0 Comments

[social4i size="small" align="align-left"] --> [This article was first published on R on Coding Club UC3M , and kindly contributed to R-bloggers ]. (You can report issue about the content on this page here ) Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

by Paula LC

Do you want to know how to make elegant and simple reproducible presentations? In this talk, we are going to explain how to do presentations in different output formats using one of the easiest and most exhaustive statistical software, R. Now, it is possible create Beamer, PowerPoint, or HTML presentations, including R code, \(\LaTeX\) equations, graphics, or interactive content.

After the tutorial, you will be able to create R presentations on your own with R Markdown in RStudio. But don’t worry if you don’t know a lot of R Markdown, because it’s really simple to use it with RStudio and you will discover the keys to master the language.

We have several options to create amazing technical presentations in pdf format with tools like PowerPoint or \(\LaTeX\) . But the truth is that when we want to generate a full and complete document with graphs, code, and text, then we invest more time in the appearance than in the content itself, or learning how to add content easily. So here I want to show you a good alternative using R. The best feature R has is the flexibility and simplicity of the code to reproduce amazing presentations with little work. To achieve it, R uses Markdown. But, what is exactly Markdown?

What is Markdown?

Markdown is a simple language to write web-based content easy both for writing and reading. The key is that it can be converted to many output formats with a simplified syntax.

Basics of Markdown

Here you have a summary guide of the main style syntax.

Code and syntax highlighting

Blockquotes, tex formula.

Besides these basics, you can to add tables, rulers, links to videos, HTML code, etc. To know more visit the creator’s web site: https://daringfireball.net/projects/markdown/ or this cheatsheet https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet .

R has a specific file format for this type of documents .Rmd . R Markdown has an online book really useful and detailed here https://bookdown.org/yihui/rmarkdown/ . This tool let you build different type of documents like the next ones:

  • Documents : HTML, \(\LaTeX\) /PDF, Microsoft Word, Tufte-style handouts
  • Interactive documents : HTML Widgets, Shiny
  • Dashboards : Gauges, values boxes, HTML Widgets, Shiny, Storyboard
  • Books : HTML, PDF, EPUB
  • JSS templates, R Journal, Skeleton, CV
  • Package Vignettes
  • Presentations : Beamer, Slidy, ioslides, reveal.js, xaringan

In the next link, you will find some examples of each one https://rmarkdown.rstudio.com/gallery.HTML . And in this cheatsheet, a good summary of R Markdown is presented https://rmarkdown.rstudio.com/lesson-15.HTML .

How to start

The first step is to get R and RStudio, and install the package rmarkdown with the code

In the last versions you can directly create presentations going to File -> New File -> R Presentation . Then, a .RPres document is going to be created. This is the simplest, really simplest, way to start but my advice is to go quickly to the next step if you want more flexibility in the slides and final appearance.

So going to File -> New File -> R Markdown and selecting the option Presentation , you are going to have different options to create your slides. Selecting any of them, a file like this is automatically generated:

ioslides_presentation logo

Depending on the final style of the output there are different output options. In the next points, we are going to explain in detail the main features of all them.

  • ioslides : the option output: ioslides_presentation
  • slidy : the option output: slidy_presentation
  • beamer : the option output: beamer_presentation

The R Markdown file

The header is the R Markdown document part where you can set the title, the author, the date, and the output as the image shows:

But at the same time, other options can be determined as follows:

Once the header is completed, you can add any kind of content that you can practically imagine: R code, equations, charts, images, videos etc. In the next points we are going to see how to add each type of content.

In addition to plain text, headers and other Markdown elements, you have the option of inserting R code which will be executed every time you run the file. These parts of the document are called R chunks . To insert an R Chunk you can use RStudio toolbar Insert button or the keyboard shortcut Ctrl + Alt + I on Windows and Cmd + Option + I on macOS.

There are a lot of options referring to how to include tables, text output, figures, etc. For example, to add the option to show in the output the R code before the results you have to add between the brackets {r } the option echo as follows {r echo=TRUE} . By default, the code is not shown.

More options:

  • cache : cache results for future knits (default = FALSE)
  • cache.path : directory to save cached results in (default = “cache/”)
  • child : file(s) to knit and then include (default = NULL)
  • collapse : collapse all output into single block (default = FALSE)
  • comment : prefix for each line of results (default = ‘##’)
  • dependson : chunk dependencies for caching (default = NULL)
  • echo : Display code in output document (default = TRUE)
  • engine : code language used in chunk (default = ‘R’)
  • error : Display error messages in doc (TRUE) or stop render when errors occur (FALSE) (default = FALSE)
  • eval : Run code in chunk (default = TRUE)
  • message : display code messages in document (default = TRUE)
  • results=asis : passthrough results
  • results=hide : do not display results
  • results=hold : put all results below all code
  • tidy : tidy code for display (default = FALSE)
  • warning : display code warnings in document (default = TRUE)
  • fig.align : ‘lef’, ‘right’, or ‘center’ (default = ‘default’)
  • fig.cap : figure caption as character string (default = NULL)
  • fig.height, fig.width : Dimensions of plots in inches
  • highlight : highlight source code (default = TRUE)
  • include : Include chunk in doc after running (default = TRUE)

In the next link you can find more details about R chunks: https://bookdown.org/yihui/rmarkdown/r-code.HTML

There is the chance to add equations to your presentations with MathJax scripts. These are included in HTML documents for rendering \(\LaTeX\) and MathML equations. To control how MathJax is included you have the next options:

  • default to use an HTTPS URL from a CDN host (currently provided by RStudio)
  • local : to use a local version of MathJax (which is copied into the output directory). Note that when using “local” you also need to set the self_contained option to false.
  • URL indicating the location to load MathJax
  • null to exclude MathJax entirely.

For example, to use a local copy of MathJax:

To use a self-hosted copy of MathJax:

You have four options to add tables. First one, directly from R Markdown

or the next ones, from R code with the libraries knitr , xtable , or stargazer .

Interactive graphs

In R there are a lot of packages to create interactive graphs. Highcharter is one of them, as well as the well-known HTMLwidgets . Here we have an example of a highcharter graph.

Presentation formats

We just explored the different contents and parts of our R Markdown document. Let’s see what type of output format we can obtain.

Ioslides is a nice R presentation format characterized by the simplicity of the result. There are some features specific from ioslides, such as the display mode

  • f : enable fullscreen mode
  • w : toggle widescreen mode
  • o : enable overview mode
  • h : enable code highlight mode
  • p : show presenter notes

or the incremental bullets:

Moreover, you can change the presentation size, the text size, or even the transition speed in the header of the document. Specifically, for the transition speed you can set the number of seconds for each slide or use the standard options: default , slower , faster .

For another hand, there is a quick way to add a background image without editing the CSS file,

But if you want to add specific style changes to your presentation, I recommend you to edit the CSS file and add it to the header of the RMarkdown document:

One of the disadvantages of ioslides is that customization is limited compared with other output formats. At the end of this tutorial we explain how to modify by your own a CSS file.

Slidy has more flexibility than ioslides as to appearance and style. Now we are going to see some of the main special features that slidy has.

There is the chance to change the display mode with the next shortcuts;

  • c : Show table of contents
  • c : Toggles the display of the footer
  • a : Toggles display of current vs all slides (useful for printing handouts)
  • s : Make fonts smaller
  • b : Make fonts larger

And we can adjust the font directly in the header of the document without editing the CSS file:

You will find other interesting features of slidy such as the countdown timer in the footer or the customized footer text that can be easily added with the options duration and footer .

Slidy themes

In slidy, there are different Boostrap themes to use drawn from the Bootswatch theme library. The themes are default , cerulean , journal , flatly , darkly , readable , spacelab , united , cosmo , lumen , paper , sandstone , simplex , and yeti . To add your own style with a CSS file, pass null in the theme parameter.

Moreover, the syntax highlighting style can be specified with the option highlight . Supported styles are default , tango , pygments , kate , monochrome , espresso , zenburn , haddock , and textmate . And you have the option of preventing syntax highlighting passing null to the parameter.

Beamer is a \(\LaTeX\) class to produce presentations and slides. It is so common in academia and so useful to add mathematical formulas and expressions. You can create your own Beamer presentations from R without a deep knowledge of \(\LaTeX\) (only Markdown).

So the first step is to install tex. Tex is a typesetting for complex mathematical formulae used in \(\LaTeX\) . To install it, download tone of the next programs, depending on your OS system: - MikTeX on Windows - MacTeX 2013+ on OS X - TeX Live 2013+ on Linux

Beamer themes are the same that you can find in \(\LaTeX\) . In the next link https://hartwork.org/beamer-theme-matrix/ you have the list of the different available header options related to the appearance and style:

There are other interesting options to create presentations in R such as reveal.js and xaringan. Reveal is very well-known because of the flexibility in the themes and transitions by default, the vertical slides or the possibility to include a web site inside a slide. In this part, we are going to explain how to generate a revealjs file and the main features of this awesome library.

First of all, it is required to install revealjs package

Then, you can directly change in the R Markdown document header the output argument to revealjs_presentation or go to menu File -> New File -> R Markdown -> From template and select reveal.js presentation.

ioslides_presentation logo

There are some amazing keyboard shortcuts:

- f for fullscreen - o or ESC for overview mode - alt or ( ctrl in Linux) and click an element, to zoom this element - s for speaker view (so pretty!) - B or . to pause the presentation

And there is a lot of variety about appearance and styles. If you want to change how the presentation looks like, you can choose any of the next theme options: default , simple , sky , beige , serif , solarized , blood , moon , night , black , league , and white . And for the syntax highlighting style: default , tango , pygments , kate , monochrome , espresso , zenburn , and haddock . Pass null to prevent syntax highlighting. The way to specify it is the same than the previous presentation types.

In revealjs you can center the text of the slides changing the center option to true, which by default is false, as well as the possibility of modifying the transitions and backgrounds, i.e. how the slide is going to move to the next one. Available transitions and background_transitions are default , fade , slide , convex , concave , zoom or none . Any of these global options can be overriden specifying the data-transition attribute in the header of the slide:

Moreover, Revealjs lets add different backgrounds like color, image, video, and iframe:

Finally, you can specify the level of heading will be used with the slide_level option. For example, if the slide_level is 2, the level-1 headers will be built horizontally and level-2 headers, vertically.

Other interesting features are the great look on touch devices, the fragmented slides, easy to export to pdf, keyboard bindings, or the parallax scrolling background.

References https://CRAN.R-project.org/package=revealjs .

Ninja presentation

The last type of presentations that we are going to see is the xaringan library. It is an R Markdown extension based on the JavaScript library remark.js ( https://remarkjs.com ). This package was originally designed for “ninja”, so it is recommended to people that have a well-known of CSS. For another hand, if you need slides to be self-contained, then xaringan it is not a good option because needs a webserver to run. Another bad news is that xaringan doesn’t work well with HTML widgets.

To install the library type

or install it directly from GitHub to ensure that you are downloading the last version

Once you get installed, go to the menu File -> New File -> R Markdown -> From template and click on ninja presentation.

ioslides_presentation logo

Note: If you understand chinese you can select the last option ;).

The header is going to look like this

A lit bit more complicated than others and as you will see, there are some funny arguments that make this library really different.

  • css : to add your own CSS file,
  • self_contained : to produce a self-contained HTML file
  • seal : to generate a title slide automatically using the YAML metadata of the R Markdown document (if FALSE, you should write the title slide by yourself)
  • yolo : to insert the Mustache Karl (TM) randomly in the slides. Using TRUE, a number between 0-1 to insert the Mustache Karl in a percentage of the slides, or even a list(times = n, img = path)
  • chakra : path to the remark.js library (can be either local or remote).
  • nature : (Nature transformation) A list of configurations to be passed to remark.create(), e.g. list(ratio = ‘16:9’, navigation = list(click = TRUE)); see https://github.com/gnab/remark/wiki/Configuration

Besides the options provided by remark.js, there are others such interesting like autoplay the slides or the countdown timer. Slides can be automatically played setting the autoplay option under nature (in milliseconds). For example, to display slides every 30 seconds and see the countdown timer:

It is possible to highlight code lines turning the option highlightLines to true or to extend the markdown syntax defining custom macros with the beforeInit option under the option nature.

Adding your CSS file

Some of the previous presentation formats give us the chance to add a customized CSS file. To know how to change a specific element you can inspect it with any web browser and focus exactly on what you want to modify by yourself. An example of a basic modification in a CSS file is the next one. Here we are selecting the background color of the body, the color of the headers and the full text for the reveal presentation, and the size of the h1 header:

Then you have to save the CSS file in the same path that your R presentation document.

How to export the presentation

With all the HTML output it is possible to export the presentation to pdf with any web browser using the menu Print to PDF from Google Chrome, for example. But there is another alternative like publishing the presentation online in RPubs or GitHub. You must be registered in any of the two platforms to be able to add your work. For RPubs, you have to invoke the More -> Publish to RPubs command from the presentation toolbar, and in GitHub, you have to create a new repository with the HTML document and all the style files associated, and enable to GitHub pages to this repository. Here you have the steps to do it: https://pages.github.com/ .

Basic example

Finally, let’s show you a simple reveal.js example to get you started.

After knitting this, here is the result:

Conclusions

RStudio is an awesome framework that provides you the chance to create nice presentations with a simple syntax, adding interactive content, and with a professional and modern style. Moreover, your presentation will be reproducible if you want to make any change, as well as you can save your templates to use them in the future. In my opinion, it is a really good alternative to other traditional software to create presentations and so easy to work with it. I hope it is so useful for you too 🙂

To leave a comment for the author, please follow the link and comment on their blog: R on Coding Club UC3M . R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job . Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Copyright © 2022 | MH Corporate basic by MH Themes

Never miss an update! Subscribe to R-bloggers to receive e-mails with the latest R posts. (You will not see this message again.)

ioslides vs. Slidify in R Markdown Presentation

The Github repository for this website : choux130/slide_thesis_ioslides . The link to my slides : https://choux130.github.io/slide_thesis_ioslides/#1

Having an opportunity to give a presentation for my master thesis, I decided to give it a try on R Markdown Presentation with interactive graphs and planned to publish it online after the presentation. There are three main choices in R Studio for the R Markdown Presentation: ioslides , Slidy , and Beamer . Beamer is for .pdf file which cannot show the interactive graphs and not meets my need for this time. Both ioslides and Slidy are for .html file which can be opened in browser and can insert interactive graphs in it. And, the main reason for me to choose ioslides rather than Slidy is simple. The sample slides for ioslides looks prettier to me! I also did some research online and found that Slidify has huge online community and popularity. So, as a person who love to explore new and good things, Slidify successfully aroused my interest.

To sum up, this post is about the comparison between ioslides and Slidify from my experience making slides for my master thesis presentation. Well, I think I am not the only one who did this kind of comparison. Check out Introduction to Presentations in Rmarkdown from Ian Kloo .

  • Already has css file in the template. You can easily customize it to meet your own needs.
  • It includes so many features which make it easier for user to create fancy slides.
  • The online communities is big and helpful.
  • The online documentation and resources is good! Slidify , Slidify and rCharts , Example slidify - Joseph V. Casillas
  • It can easily be published to Github Pages.
  • Though it works well for rendering interactive graphs, it is time consuming. I am not sure the reason, maybe it is because it has too many features. This is also the main reason for me to jump to ioslides.
  • It takes time to be familiar with its settings and structure. It is just a little bit complicated.
  • It can render htmlwidgets but the size and other features can not be adjusted. What a pity!
  • The time for compiling is not too bad especially when we have many interactive graphs in it.
  • The template is not so complex, so it is easy to understand the structure by looking at the source code.
  • The document from R Studio is also good! http://rmarkdown.rstudio.com/ioslides_presentation_format.html
  • It can be published on the Github Pages. You just need to rename the generated .html file to index.html and then put the file in the gh-pages branch of your github. To see how I did it, Github repo - slide_thesis_ioslides .
  • If you want more features, you have to write your own CSS code. So, it may be overwhelming if you do not have any foundation to CSS and HTML.
  • Like Slidify, it can render htmlwidgets but the size and other features can not be adjusted. This means that it is useless if you try to adjust the size using this code, <iframe src="/path/name.html" width="200" height="200"></iframe> .
  • Plotly To make ggplot become interactive.
  • DT To make table become interactive.
  • htmlwidgets Save the interactive output generated from plotly and DT as HTML widgets and then insert widgets in desired place using code, <iframe src="/path/name.html"></iframe> .

Examples My final slides : https://choux130.github.io/slide_thesis_ioslides/#1 All the ioslides files : Github repo - slide_thesis_ioslides

Slide Presentations

R Markdown renders to four presentation formats:

  • beamer_presentation - PDF presentations with beamer
  • ioslides_presentation - HTML presentations with ioslides
  • slidy_presentation - HTML presentations with slidy
  • powerpoint_presentation - PowerPoint presentation
  • revealjs::revealjs_presentation - HTML presentations with reveal.js

Each format will intuitively divide your content into slides, with a new slide beginning at each first or second level header.

Insert a horizontal rule ( *** ) into your document to create a manual slide break. Create incremental bullets with >- , as in the .Rmd file below, which is available here on RStudio Cloud.

ioslides_presentation logo

Continue to Dashboards

rstudio/rmarkdown Dynamic Documents for R

  • all_output_formats: Determine all output formats for an R Markdown document
  • available_templates: List available R Markdown template in a package
  • beamer_presentation: Convert to a Beamer presentation
  • compile_notebook: Compiling R scripts to a notebook
  • context_document: Convert to a ConTeXt document
  • convert_ipynb: Convert a Jupyter/IPython notebook to an R Markdown document
  • default_output_format: Determine the default output format for an R Markdown...
  • draft: Create a new document based on a template
  • find_external_resources: Find External Resource References
  • find_pandoc: Find the 'pandoc' executable
  • github_document: Convert to GitHub Flavored Markdown
  • html-dependencies: Provide common HTML dependencies for R Markdown formats
  • html_document: Convert to an HTML document
  • html_document_base: Base output format for HTML-based output formats
  • html_fragment: Convert to an HTML fragment.
  • html_notebook: Convert to an HTML notebook
  • html_notebook_metadata: Generate R Notebook Metadata
  • html_notebook_output: Generate R Notebook Output
  • html_vignette: Convert to an HTML vignette
  • includes: Include content within output
  • ioslides_presentation: Convert to an ioslides Presentation
  • knit_params_ask: Run a shiny application asking for parameter configuration...
  • knitr_options: Knitr options for an output format
  • knitr_options_html: Knitr options for an HTML output format
  • knitr_options_pdf: Knitr options for a PDF output format
  • latex-dependencies: Provide common LaTeX dependencies
  • latex_dependency: Define a LaTeX package dependency
  • md_document: Convert to a markdown document
  • metadata: The YAML metadata of the current R Markdown document
  • navbar_html: Create a navbar HTML file from a navbar definition
  • odt_document: Convert to an OpenDocument Text (ODT) document
  • output_format: Define an R Markdown output format
  • output_format_dependency: Define and merge an R Markdown's output format dependency
  • output_metadata: The output metadata object
  • paged_table: Create a table in HTML with support for paging rows and...
  • pandoc_args: Functions for generating pandoc command line arguments
  • pandoc_available: Check pandoc availability and version
  • pandoc_citeproc_convert: Convert a bibliograpy file
  • pandoc_convert: Convert a document with pandoc
  • pandoc_exec: Get the path of the pandoc executable
  • pandoc_options: Pandoc options for an output format
  • pandoc_path_arg: Transform path for passing to pandoc
  • pandoc_self_contained_html: Create a self-contained HTML document using pandoc.
  • pandoc_template: Render a pandoc template.
  • parse_html_notebook: Parse an HTML Notebook
  • pdf_document: Convert to a PDF/LaTeX document
  • pkg_file_lua: Get the full paths of Lua filters in an R package
  • powerpoint_presentation: Convert to a PowerPoint presentation
  • publish_site: Publish an R Markdown Website
  • relative_to: Relative path utility function
  • Browse all...

ioslides_presentation : Convert to an ioslides Presentation In rstudio/rmarkdown: Dynamic Documents for R

View source: R/ioslides_presentation.R

Convert to an ioslides Presentation

Description.

Format for converting from R Markdown to an ioslides presentation.

See the online documentation for additional details on using the ioslides_presentation format.

Note that, if a before_body include is specified in includes , then it will replace the standard title slide entirely.

Regarding previewing slide in RStudio IDE, ioslides_presentation() will always open preview in a new Window and the RStudio IDE configuration "Open in Viewer Pane" will have no effect for this format.

R Markdown output format to pass to render() .

Slide Basics

You can create a slide show broken up into sections by using the # and ## heading tags (you can also create a new slide without a header using a horizontal rule ( ⁠----------⁠ ). For example here's a simple slide show:

You can add a subtitle to a slide or section by including text after the pipe (|) character. For example:

Display Modes

The following single character keyboard shortcuts enable alternate display modes:

enable fullscreen mode

toggle widescreen mode

enable overview mode

enable code highlight mode

show presenter notes

Pressing Esc exits all of these modes. See the sections below on Code Highlighting and Presenter Mode for additional detail on those modes.

Incremental Bullets

You can render bullets incrementally by adding the incremental option:

If you want to render bullets incrementally for some slides but not others you can use this syntax:

Presentation Size

You can display the presentation using a wider form factor using the widescreen option. You can specify that smaller text be used with the smaller option. For example:

You can also enable the smaller option on a slide-by-slide basis by adding the .smaller attribute to the slide header:

Adding a Logo

You can add a logo to the presentation using the logo option (the logo should be square and at least 128x128). For example:

A 128x128 version of the logo graphic will be added to the title slide and an icon version of the logo will be included in the bottom-left footer of each slide.

Build Slides

Slides can also have a .build attribute that indicate that their content should be displayed incrementally. For example:

Slide attributes can be combined if you need to specify more than one, for example:

Code Highlighting

It's possible to select subsets of code for additional emphasis by adding a special "highlight" comment around the code. For example:

The highlighted region will be displayed with a bold font. When you want to help the audience focus exclusively on the highlighted region press the 'h' key and the rest of the code will fade away.

The ioslides template has an attractive default style for tables so you shouldn't hesitate to add tables for presenting more complex sets of information. Pandoc markdown supports several syntaxes for defining tables which are described in the pandoc online documentation .

Advanced Layout

You can center content on a slide by adding the .flexbox and .vcenter attributes to the slide title. For example:

You can horizontally center content by enclosing it in a div tag with class centered . For example:

You can do a two-column layout using the columns-2 class. For example:

Note that content will flow across the columns so if you want to have an image on one side and text on the other you should make sure that the image has sufficient height to force the text to the other side of the slide.

You can color content using base color classes red, blue, green, yellow, and gray (or variations of them e.g. red2, red3, blue2, blue3, etc.). For example:

Presenter Mode

A separate presenter window can also be opened (ideal for when you are presenting on one screen but have another screen that's private to you). The window stays in sync with the main presentation window and also shows presenter notes and a thumbnail of the next slide. To enable presenter mode add ?presentme=true to the URL of the presentation, for example:

The presenter mode window will open and will always re-open with the presentation until it's disabled with:

To add presenter notes to a slide you include it within a "notes" div . For example:

Printing and PDF Output

You can print an ioslides presentation from within browsers that have good support for print CSS (i.e. as of this writing Google Chrome has the best support). Printing maintains most of the visual styles of the HTML version of the presentation.

To create a PDF version of a presentation you can use Print to PDF from Google Chrome.

Related to ioslides_presentation in rstudio/rmarkdown ...

R package documentation, browse r packages, we want your feedback.

ioslides_presentation logo

Add the following code to your website.

REMOVE THIS Copy to clipboard

For more information on customizing the embed code, read Embedding Snippets .

R Markdown: The Definitive Guide

4.2 slidy presentation.

To create a Slidy presentation from R Markdown, you specify the slidy_presentation output format in the YAML metadata of your document. You can create a slide show broken up into sections by using the ## heading tag (you can also create a new slide without a header using a horizontal rule ( --- ). For example, here is a simple slide show (see Figure 4.2 for two sample slides):

Two sample slides in a Slidy presentation.

FIGURE 4.2: Two sample slides in a Slidy presentation.

4.2.1 Display modes

The following single character keyboard shortcuts enable alternate display modes:

  • 'C' : Show table of contents (the right sub-figure in Figure 4.2 has shown the table of contents).
  • 'F' : Toggles the display of the footer.
  • 'A' : Toggles display of current vs all slides (useful for printing handouts).
  • 'S' : Make fonts smaller.
  • 'B' : Make fonts larger .

4.2.2 Text size

You can use the font_adjustment option to increase or decrease the default font size (e.g., -1 or +1 ) for the entire presentation. For example:

If you want to decrease the text size on an individual slide you can use the .smaller slide attribute. For example:

If you want to increase the text size on an individual slide you can use the .bigger slide attribute. For example:

You can also manually adjust the font size during the presentation using the 'S' (smaller) and 'B' (bigger) keys.

4.2.3 Footer elements

You can add a countdown timer to the footer of your slides using the duration option (duration is specified in minutes). For example:

You can also add custom footer text (e.g., organization name and/or copyright) using the footer option. For example:

4.2.4 Other features

Refer to Section 3.1 for the documentation of other features of Slidy presentations, including figure options (Section 3.1.5 ), appearance and style (Section 3.1.4 ), MathJax equations (Section 3.1.8 ), data frame printing (Section 3.1.6 ), Markdown extensions (Section 3.1.10.4 ), keeping Markdown (Section 3.1.10.1 ), document dependencies (Section 3.1.9 ), header and before/after body inclusions (Section 3.1.10.2 ), custom templates (Section 3.1.10.3 ), Pandoc arguments (Section 3.1.10.5 ), and shared options (Section 3.1.11 ).

Slidy presentations have several features in common with ioslides presentations in Section 4.1 . For incremental bullets, see Section 4.1.2 . For custom CSS, see Section 4.1.3.5 . For printing Slidy slides to PDF, see Section 4.1.10 .

ioslides_presentation logo

  • ioslides_presentation

R ioslides_presentation

Format for converting from R Markdown to an ioslides presentation. ioslides_presentation is located in package rmarkdown . Please install and load package rmarkdown before use.

logo Path to file that includes a logo for use in the presentation (should be square and at least 128x128). slide_level Header level to consider as slide separator (Defaults to header 2). incremental TRUE to render slide bullets incrementally. individual bullet you can preceded it with > . For example: > - Bullet Text . fig_width Default width (in inches) for figures fig_height Default height (in inches) for figures fig_retina Scaling to perform for retina displays (defaults to 2, which currently works for all widely used retina displays). Set to NULL to keep_md is specified (this is because fig_retina relies on outputting HTML directly into the markdown document). fig_caption TRUE to render figures with captions dev Graphics device to use for figure output (defaults to png) df_print Method to be used for printing data frames. Valid values include "default", "kable", "tibble", and "paged". The "default" method uses a corresponding S3 method of print , typically print.data.frame . The "kable" method uses the knitr::kable function. The "tibble" method uses the tibble package to print a summary of the data frame. The "paged" method creates a paginated HTML table (note that this method is only valid for formats that produce HTML). In addition to the named methods you can also pass an arbitrary function to be used for printing data frames. You can disable the df_print behavior entirely by setting the option rmarkdown.df_print to FALSE . smart Produce typographically correct output, converting straight quotes to curly quotes, --- to em-dashes, -- to en-dashes, and ... to ellipses. self_contained Produce a standalone HTML file with no external dependencies, using data: URIs to incorporate the contents of linked documents MathJax is still loaded externally (this is necessary because of its size). widescreen Display presentation with wider dimensions. smaller Use smaller text on all slides. You can also enable this for individual slides by adding the .smaller attribute to the slide header (see Presentation Size below for details). transition Speed of slide transitions. This can be "default", "slower", "faster", or a numeric value with a number of seconds (e.g. 0.5). mathjax Include mathjax. The "default" option uses an https URL from a MathJax CDN. The "local" option uses a local version of MathJax (which is copied into the output directory). You can pass an alternate URL or pass NULL to exclude MathJax entirely. analytics A Google analytics property ID. template Pandoc template to use for rendering. Pass "default" to use the rmarkdown package default template; pass NULL to use pandoc's built-in template; pass a path to use a custom template that you've created. html_document won't be available (see the Templates section below for more details). css One or more css files to include includes Named list of additional content to include within the document (typically created using the includes function). keep_md Keep the markdown file generated by knitting. lib_dir Directory to copy dependent HTML libraries (e.g. jquery, bootstrap, etc.) into. By default this will be the name of the document with _files appended to it. md_extensions Markdown extensions to be added or removed from the default definition or R Markdown. See the rmarkdown_format for additional details. pandoc_args Additional command line options to pass to pandoc extra_dependencies Additional function arguments to pass to the base R Markdown HTML output formatter html_document_base ... Additional function arguments to pass to the base R Markdown HTML output formatter html_document_base

Return Values: R Markdown output format to pass to render .

Details: See the online documentation for additional details on using the ioslides_presentation format.

Slide Basics: You can create a slide show broken up into sections by using the # and ## heading tags (you can also create a new slide without a header using a horizontal rule ( ---------- ). For example here's a simple slide show:

You can add a subtitle to a slide or section by including text after the pipe (|) character. For example:

Display Modes: The following single character keyboard shortcuts enable alternate display modes:

   •  'f' enable fullscreen mode

   •  'w' toggle widescreen mode

   •  'o' enable overview mode

   •  'h' enable code highlight mode

   •  'p' show presenter notes

Pressing Esc exits all of these modes. See the sections below on Code Highlighting and Presenter Mode for additional detail on those modes.

Incremental Bullets: You can render bullets incrementally by adding the incremental option:

If you want to render bullets incrementally for some slides but not others you can use this syntax:

Presentation Size: You can display the presentation using a wider form factor using the widescreen option. You can specify that smaller text be used with the smaller option. For example:

You can also enable the smaller option on a slide-by-slide basis by adding the .smaller attibute to the slide header:

Adding a Logo: You can add a logo to the presentation using the logo option (the logo should be square and at least 128x128). For example:

A 128x128 version of the logo graphic will be added to the title slide and an icon version of the logo will be included in the bottom-left footer of each slide.

Build Slides: Slides can also have a .build attribute that indicate that their content should be displayed incrementally. For example:

Slide attributes can be combined if you need to specify more than one, for example:

Code Highlighting: It's possible to select subsets of code for additional emphasis by adding a special "highlight" comment around the code. For example:

The highlighted region will be displayed with a bold font. When you want to help the audience focus exclusively on the highlighted region press the 'h' key and the rest of the code will fade away.

Tables: The ioslides template has an attractive default style for tables so you shouldn't hesitate to add tables for presenting more complex sets of information. Pandoc markdown supports several syntaxes for defining tables which are described in the pandoc online documentation .

Advanced Layout: You can center content on a slide by adding the .flexbox and .vcenter attributes to the slide title. For example:

You can horizontally center content by enclosing it in a div tag with class centered . For example:

You can do a two-column layout using the columns-2 class. For example:

Text Color: You can color content using base color classes red, blue, green, yellow, and gray (or variations of them e.g. red2, red3, blue2, blue3, etc.). For example:

Presenter Mode: A separate presenter window can also be opened (ideal for when you are presenting on one screen but have another screen that's private to you). The window stays in sync with the main presentation window and also shows presenter notes and a thumbnail of the next slide. To enable presenter mode add ?presentme=true to the URL of the presentation, for example:

The presenter mode window will open and will always re-open with the presentation until it's disabled with:

To add presenter notes to a slide you include it within a "notes" div . For example:

Printing and PDF Output: You can print an ioslides presentation from within browsers that have good support for print CSS (i.e. as of this writing Google Chrome has the best support). Printing maintains most of the visual styles of the HTML version of the presentation.

To create a PDF version of a presentation you can use Print to PDF from Google Chrome.

ioslides_presentation logo

Navigation Menu

Search code, repositories, users, issues, pull requests..., provide feedback.

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly.

To see all available qualifiers, see our documentation .

  • Notifications

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.2.2 Adjusting font-size in ioslides using R Markdown #30

@jananiravi

jananiravi commented Jul 23, 2018

@dr-harper

dr-harper commented Jul 23, 2018

  • 👍 5 reactions

Sorry, something went wrong.

@jananiravi

No branches or pull requests

@jananiravi

COMMENTS

  1. Presentations with ioslides

    Adding a Logo. You can add a logo to the presentation using the logo option (by default, the logo will be displayed in a 85x85 pixel square). For example:--- output: ioslides_presentation: logo: logo.png ---The logo graphic will be rescaled to 85x85 (if necessary) and added to the title slide.

  2. 4.1 ioslides presentation

    4.1 ioslides presentation. To create an ioslides presentation from R Markdown, you specify the ioslides_presentation output format in the YAML metadata of your document. You can create a slide show broken up into sections by using the # and ## heading tags (you can also create a new slide without a header using a horizontal rule (---).For example here is a simple slide show (see Figure 4.1 for ...

  3. Convert to an ioslides Presentation

    ---output: ioslides_presentation: logo: logo.png---A 128x128 version of the logo graphic will be added to the title slide and an icon version of the logo will be included in the bottom-left footer of each slide. Build Slides. Slides can also have a .build attribute that indicate that their content should be displayed incrementally. For example:

  4. How to add logo to each slide in ioslides in RStudio

    10. I am trying to add logo to each slide in rmarkdown in ioslides presentation, using RStudio. My code is below: ioslides_presentation: widescreen: false. logo: logo_wp.png. and the logo can be downloaded from here! There is no logo on slide nr 3. runtime: shiny is needed because there is a shiny app in that presentation.

  5. R Markdown Presentation

    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: ... logo.png (set a logo with the size of 85 * 85 ) headers and bulletpoints. Similar to documents, headers have levels and is specified by #, ## or

  6. ioslides_presentation : ioslides_presentation

    Format for converting from R Markdown to an ioslides presentation. rdrr.io Find an R package R language docs Run R in your browser. mcanouil/mctemplates Mickaël Canouil's Rmarkdown & Rstudio templates ... Path to file that includes a logo for use in the presentation (should be square and at least 128x128). slide_level:

  7. rmarkdown source: R/ioslides_presentation.R

    For example: #' ```markdown #' --- #' output: #' ioslides_presentation: #' logo: logo.png #' --- #' ``` #' A 128x128 version of the logo graphic will be added to the title slide and #' an icon version of the logo will be included in the bottom-left footer of #' each slide. #' @section Build Slides: #' Slides can also have a `.build` attribute ...

  8. Slides in RMarkdown ioslides Example Doc

    Slides in RMarkdown ioslides Example Doc - Amazon Web ServicesLearn how to create and customize slides in RMarkdown using the ioslides format. This document shows you ...

  9. Logo on Ioslides : r/rstats

    Logo on Ioslides . Hi all! I'm doing a presentation in ioslides and I could figure how to show a logo, but now it's showing on all slides. ... "2021-02-16" output: ioslides_presentation: widescreen: true logo: your_problematic_logo.png css: whatever_you_want.css ---Reply Background_Tension36 • Additional comment actions ...

  10. Mastering R presentations

    How to start. The first step is to get R and RStudio, and install the package rmarkdown with the code. install.packages("rmarkdown") In the last versions you can directly create presentations going to File -> New File -> R Presentation.Then, a .RPres document is going to be created. This is the simplest, really simplest, way to start but my advice is to go quickly to the next step if you want ...

  11. 8.4 Slide backgrounds

    The first official book authored by the core R Markdown developers that provides a comprehensive and accurate reference to the R Markdown ecosystem. With R Markdown, you can easily create reproducible data analysis reports, presentations, dashboards, interactive applications, books, dissertations, websites, and journal articles, while enjoying the simplicity of Markdown and the great power of ...

  12. ioslides vs. Slidify in R Markdown Presentation

    There are three main choices in R Studio for the R Markdown Presentation: ioslides, Slidy, and Beamer. Beamer is for .pdf file which cannot show the interactive graphs and not meets my need for this time. Both ioslides and Slidy are for .html file which can be opened in browser and can insert interactive graphs in it.

  13. Slide Presentations

    Turn your analyses into high quality documents, reports, presentations and dashboards with R Markdown. Use a productive notebook interface to weave together narrative text and code to produce elegantly formatted output. Use multiple languages including R, Python, and SQL. R Markdown supports a reproducible workflow for dozens of static and dynamic output formats including HTML, PDF, MS Word ...

  14. ioslides_presentation : Convert to an ioslides Presentation

    Details. See the online documentation for additional details on using the ioslides_presentation format.. Note that, if a before_body include is specified in includes, then it will replace the standard title slide entirely.. Regarding previewing slide in RStudio IDE, ioslides_presentation() will always open preview in a new Window and the RStudio IDE configuration "Open in Viewer Pane" will ...

  15. 4.2 Slidy presentation

    4.2 Slidy presentation. To create a Slidy presentation from R Markdown, you specify the slidy_presentation output format in the YAML metadata of your document. You can create a slide show broken up into sections by using the ## heading tag (you can also create a new slide without a header using a horizontal rule (---).For example, here is a simple slide show (see Figure 4.2 for two sample slides):

  16. R ioslides_presentation -- EndMemo

    --- output: ioslides_presentation: logo: logo.png --- A 128x128 version of the logo graphic will be added to the title slide and an icon version of the logo will be included in the bottom-left footer of each slide. Build Slides: Slides can also have a .build attribute that indicate that their content should be displayed incrementally. For example:

  17. css

    I'm working on a presentation with ioslides (Rmarkdown). Since the corporate design rules for our university state that the logo should be on the right side (so the two faces look into the document) I'ld be happy if someone can help me with adjusting the ioslide theme via css or in the pandoc template.

  18. 4.2.2 Adjusting font-size in ioslides using R Markdown #30

    Quick question. I read the sections on adjusting font-size in slides (R Markdown, ioslides presentation). Seems like I can use {.smaller} to change it for the whole slide. I also read that footers can be added (if included in the file definition 4.2.3). Qn: Is there a way to adjust the font size of individual lines in a particular slide?

  19. How to permanently embed images in an ioslides presentation?

    0. I'm having trouble permanently embedding images in my RStudio ioslides presentation. Specifically, the problem occurs when I try to include local images via: ![](image.png) The images will appear successfully when I knit the document and open it directly from its folder on my computer. But if I share the html file with anyone else or copy ...