Reputation: 1508
I want to insert a few emojis into my rmarkdown
document.
devtools::install_github("hadley/emo")
library(emo)
emo::ji('turtle')
# 🐢
However, when I knit my document in the emojis won't render. In this example the chunk render doesn't work but the inline one does:
Example for not rendering:
``` {r}
library(emo)
emo::ji('smile')
```
Inline example:
`r emo::j('smile')`
But then here the inline doesn't work as well:
<font color='skyblue'>*Hey, you! Marine biologist! I have need of your services!
A sea turtle begins its life amidst great danger, and not very many of them make it to the water. See, I'm working on a big budget movie - think "Saw", but with turtles. Anyway, let's make some realistic numbers of turtles for me to... **keep alive.***</font> `r emo::ji('turtle')`
I've updated everything I could think of (R, Rstudio, all markdown-related packages) but alas.
Upvotes: 2
Views: 762
Reputation: 1508
After hours of searching I found that the problem was with the native encoding of my session. As presented in this answer, I did File -> Reopen with Encoding... and selected UTF-8
, and for good measure selected UTF-8
to be the default in the future. Knitted the file - worked like a charm.
Upvotes: 3