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.
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
)
An htmltools::tagList() with the Add Logo dependencies, or an
htmltools::htmlDependency().
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 in CSS units of the logo
Height in CSS units of the logo
The position of the logo from the sides of the slide. Use
css_position() to specify.
Optional. If provided, your logo becomes a clickable link.
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.
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.
use_logo(): Adds logo to your xaringan slides.
html_dependency_logo(): Returns an htmltools::htmlDependency() with the tile
view dependencies. Most users will want to use use_logo().
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.
xaringan_logo <- file.path(
"https://raw.githubusercontent.com/rstudio/hex-stickers/master",
"PNG/xaringan.png"
)
use_logo(xaringan_logo)
Run the code above in your browser using DataLab