xaringan R Package Documentation

repository·master·Indexed 23 days ago

https://github.com/yihui/xaringan

An R package for creating professional slideshows using R Markdown, powered by the remark.js engine. It provides the moon_reader() output format and integrates with RStudio for presentation creation and live preview via the Infinite Moon Reader addin.

Tokens
451
Snippets
1
Records
4
Agent score
31%

What's inside xaringan

  1. Formatting slides and syntax limitations

    master

    The xaringan package builds upon remark.js. While it simplifies several aspects (like removing the need for boilerplate HTML and providing easy autoplay via moon_reader() options), there are important syntax considerations:

    • Markdown Compatibility: remark.js does not support Pandoc's Markdown. Avoid using advanced Pandoc-specific features.
    • Math: LaTeX math is supported out of the box.
    • HTML: You can use raw HTML for elements not supported by the basic Markdown syntax (e.g., using knitr::kable(head(iris), 'html') for tables).
    • Styling: You can use CSS to customize the appearance of your slides. The package provides a default CSS theme, but users can extend it using custom CSS.
  2. Quickstart in RStudio

    master

    If you are using RStudio, you can quickly create a new presentation using the built-in template system:

    1. Go to File -> New File -> R Markdown -> From Template -> Ninja Presentation.
    2. This will open an R Markdown example.
    3. Click the Knit button to compile the slides into an HTML presentation.
    4. To use live preview, use the RStudio Addin Infinite Moon Reader. The slides will automatically reload whenever you save the Rmd document (ensure the Rmd document has focus when clicking the addin).
  3. Install xaringan from GitHub

    master

    You can install the development version of xaringan using the remotes package. This is useful if you want the latest features or if you are not using the CRAN version.

    remotes::install_github('yihui/xaringan')
  4. Generate slides using moon_reader()

    master
    The primary output format for creating presentations in xaringan is moon_reader(). This function is used within the R Markdown YAML metadata to configure the presentation output. For a full list of configuration options, refer to the R help page ?xaringan::moon_reader.