Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix emojis in PDF output #257

Open
Tazinho opened this issue Dec 23, 2020 · 2 comments
Open

Fix emojis in PDF output #257

Tazinho opened this issue Dec 23, 2020 · 2 comments

Comments

@Tazinho
Copy link
Owner

Tazinho commented Dec 23, 2020

The encoding issue in the PDF output (see e.g. S4 emoji exercises), are also in the whole R6 chapter. E.g. the colors (heart, spade, etc.) for my_deck$draw(52) are not correctly rendered.

@henningsway
Copy link
Collaborator

henningsway commented Dec 24, 2020

just found this commit hadley/adv-r@3915c3a, which seems to offer a solution for the emojis in s4.

@henningsway henningsway changed the title Fix encodings in PDF output Fix missing symbols (emojis / unicode) in PDF output Dec 25, 2020
@henningsway henningsway changed the title Fix missing symbols (emojis / unicode) in PDF output Fix missing symbols emojis in PDF output Dec 25, 2020
henningsway added a commit that referenced this issue Dec 25, 2020
@henningsway henningsway removed their assignment Dec 25, 2020
@henningsway
Copy link
Collaborator

I've just applied Hadley's "emoji embedding strategy" for the emojis in S4.

The strategy comes down to creating latex-code to include and inline image of the emoji (which is downloaded automatically), when the output-type is pdf. Because this code is generated by code, it only works as an inline command - otherwise the code will be evaluated.

Because of this is doesn't work for the the R6 emoji. Here, I've instead tried to use the https://github.com/mreq/xelatex-emoji latex-package, but couldn't get it to work (with the rmarkdown).
I've replaced the ♠ with SPADE for now etc.

Maybe @hadley has a good suggestion how to fix this. As we've seen in the print it's actually not solved in Advanced R yet also. 🤓

@henningsway henningsway changed the title Fix missing symbols emojis in PDF output Fix emojis in PDF output Dec 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants