Skip to content

Latest commit

 

History

History
62 lines (41 loc) · 1.58 KB

README.md

File metadata and controls

62 lines (41 loc) · 1.58 KB

xelatex-emoji

Emoji support for XeLaTeX documents

Installation

Clone this repo into your texmf folder or to the project folder. Clone emoji images named after the utf8 code - I recommend EmojiOne.

Note: Tex doesn't natively support SVG, so if you download the vector emojis, you can convert them to PDFs with the following command on Mac and Linux: (assumes you have installed the librsvg2-bin package in Linux

# For Mac OS X:
$ brew install librsvg

# For Linux:
$ sudo apt-get install librsvg2-bin

# Then, run:
$ rsvg-convert -f pdf -o <emoji-UTF-code>.pdf <emoji-UTF-code>.svg

If you don't want to hand convert massive emoji SVGs, run the svgs-to-pdfs command (included this repo) in the folder where the SVGs are:

./svgs-to-pdfs ./*.svg

Usage

Use the xelatexemoji package. Enjoy :)

Example layout

\documentclass{article}

\usepackage{xltxtra}
\usepackage{xelatexemoji}

\setmainfont{Ubuntu}

\begin{document}

  Hello, 🌎. Lorem 😃 😄 😅 😆 ipsum dolor.

\end{document}

yields (using the great EmojiOne images)

example result

Image path

By default, xelatex-emoji expects the images to be in images/utf8code.png. You can change the path and extension by creating your own \xelatexemojipath command.

\newcommand{\xelatexemojipath}[1]{mycustompath/#1.pdf}

Development

To generate the flag codes:

ruby bin/generate_flags.rb > xelatexemoji-flags.sty