0

I'm using bookdown to generate both a website and a pdf. I've added some emojies using the r package emo. There is no problem when building the site, they are displayed ok.

But when creating the pdf these emojis are not displayed, although they are shown in the .tex file. So my guess is the problem is converting from tex to pdf.

I'm using these commands:

rmarkdown::clean_site()
rmarkdown::render_site(output_format = 'bookdown::pdf_book', encoding = 'UTF-8')

Session info:

> rmarkdown::pandoc_version()
[1] ‘1.17.2’
> system('pdflatex --version')
pdfTeX 3.14159265-2.6-1.40.18 (TeX Live 2017)
kpathsea version 6.2.3
Copyright 2017 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.29; using libpng 1.6.29
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 3.04

R version 3.4.1 
macOS Sierra 10.12.6
rmarkdown_1.6

Thanks!

alistaire
  • 42,459
  • 4
  • 77
  • 117
Pablo Casas
  • 868
  • 13
  • 15
  • 1
    I'm not a LaTeX expert, but I'm pretty sure it's a font issue. [Here's a LaTeX package](https://github.com/alecjacobson/coloremoji.sty) that may solve the problem; you can include it via the YAML frontmatter. – alistaire Sep 03 '17 at 21:23
  • Thanks @alistaire! I followed the installation instructions, and then I added the line `\usepackage{coloremoji}` in preamble.tex, and a new error appears:`Package mathspec Error: `amsmath' must be loaded earlier than `mathspec'.` Any ideas? – Pablo Casas Sep 04 '17 at 14:54
  • Put it in the YAML: https://tex.stackexchange.com/a/211638/120019 – alistaire Sep 04 '17 at 18:49
  • Thanks. I really don't know how to do that using bookdown, according to https://github.com/rstudio/bookdown/issues/227 it's just a line in the `_output.yml`, but adding `usepackage: coloremoji `doesnt work. – Pablo Casas Sep 05 '17 at 00:35
  • [Yihui's link there](https://bookdown.org/yihui/bookdown/yaml-options.html) contains an example which just saves it in an external .tex file. I'd start with a version of that, and then see if you can simplify without breaking it. And watch your indentation. – alistaire Sep 05 '17 at 18:57
  • I used the installation command from the README.md of [https://github.com/alecjacobson/coloremoji.sty](https://github.com/alecjacobson/coloremoji.sty) and added `\usepackage{coloremoji}` in `preamble.tex` but got the error message `restricted \write18` (using the bookdown-package) – petzi Oct 07 '17 at 16:01

0 Answers0