Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using emoji in xaringan presentation

I'd like to know if there is a way to use markdown syntax for adding emoji in xaringan presentation. A minimal example would be

---

# Slide #1 :smile:

---

that would produce

Slide #1 😄

Thanks!

like image 928
J.P. Le Cavalier Avatar asked Jul 01 '18 15:07

J.P. Le Cavalier


1 Answers

Since xaringan is an html5 page, you can insert an emoji in it like any other webpage. Multiple ways to do so:

  1. Insert emoji directly: copy & paste the emoji 😄 into the rmd, knit your slides and it'll work.

  2. Insert unicode emoji using HTML character escape:

    • From this wiki page you can lookup an emoticon and copy & paste the html code☀ into your rmd file, which will be rendered as ☀ . The &# and ; are used to escape the unicode character.
  3. There's a package emo by Hadley, which is designed to make it very easy to insert emoji into RMarkdown documents." so you can do

    ---
    
    # Slide #1 `r emo::ji("smile")`
    
    ---
    
like image 154
TC Zhang Avatar answered Nov 07 '22 15:11

TC Zhang