logo {xaringanExtra}R Documentation

Add Logo

Description

use_logo() adds a logo to all of your slides. You can make the logo a clickable link and choose where on the page it is placed. You can also set which types of slides will not get the logo by default.

Usage

use_logo(
  image_url,
  width = "110px",
  height = "128px",
  position = css_position(top = "1em", right = "1em"),
  link_url = NULL,
  exclude_class = c("title-slide", "inverse", "hide_logo")
)

html_dependency_logo(
  link_url = NULL,
  exclude_class = c("title-slide", "inverse", "hide_logo"),
  inline = NULL
)

Arguments

image_url

The URL to the image file of your logo. In general, either a full URL or the path to the image relative to your slides file.

width

Width in CSS units of the logo

height

Height in CSS units of the logo

position

The position of the logo from the sides of the slide. Use css_position() to specify.

link_url

Optional. If provided, your logo becomes a clickable link.

exclude_class

The slide classes that should not receive the logo. By default, the title slide, inverse slides and slides with the hide_logo class are excluded.

inline

In html_dependency_logo(), should the JS and CSS code to create the logo be returned inline (inside the rendered slides) or in separate CSS and JS documents attached as an html dependency? The default is to use inline for xaringan version 0.16 or later.

Value

An htmltools::tagList() with the Add Logo dependencies, or an htmltools::htmlDependency().

Functions

Usage

To add a logo to your xaringan presentation, add the following code chunk to your slides' R Markdown file.

```{r xaringan-logo, echo=FALSE}
xaringanExtra::use_logo(
  image_url = "https://raw.githubusercontent.com/rstudio/hex-stickers/master/PNG/xaringan.png"
)
```

See the documentation for ?use_logo for more options regarding sizing and positioning. You can also make the logo a link using link_url and you can hide the logo for a particular slide by using the hide_logo slide class.

Examples

xaringan_logo <- file.path(
  "https://raw.githubusercontent.com/rstudio/hex-stickers/master",
  "PNG/xaringan.png"
)
use_logo(xaringan_logo)


[Package xaringanExtra version 0.8.0 Index]