Adding Emoji to your LaTeX document

I found a rather quick way to get emoji in my document. But this is the brute force quick way. The russian way. It always works but is not that elegant. PDF-images.

How to

  1. Read this blog post „Emoji in LaTeX documents“
  2. Download the hires emoji-images in this github-repo
  3. Search the emoji-PDF files you need for your document
  4. Copy them to the folder where your .tex-document resides
  5. Define a shortcut/macro to include those emoji-PDF files you need
  6. Include the following code in your .tex-document
\usepackage{scalerel} % needed package to scale the pdf-images perfectly
\def\emojithumbup{\scalerel*{\includegraphics{emoji_thumbup_1F44D.pdf}}{O}}
\def\emojistar{\scalerel*{\includegraphics{emoji_star_2B50.pdf}}{0}}

In your document

This my five star rating
\emojistar\emojistar\emojistar\emojistar\emojistar
I would say \emojithumbup for this easy integration.

Why do I blog this? Because when I tried to integrate the coloremoji.sty class in my LaTeX document, I got a series of issues with conflicting textinput encodings not matching the one the coloremoji expects. This way your avoid any new encoding issues by directly integrating PDF-images which is what will happen anyway with that class. maybe you need to include \usepackage[pdftex]{graphicx} too.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.