3

I would like to insert an emoticon (Unicode 10. code point 1F600) into my document. Mine just shows a tofu box.

Here is my failing example:

\documentclass[9pt]{memoir}
\usepackage[Latin,Greek,Emoticons]{ucharclasses}
\usepackage{fontspec}

\newfontfamily\substitutefont{Times New Roman}
\setDefaultTransitions{\begingroup\substitutefont}{\endgroup}

\begin{document}

The standard
consists of various documents or charts that map \emph{code points} (hexadecimal
numbers such as \texttt{0048} or \texttt{1F600}) to glyphs (such as \texttt{H} or \texttt{😀}), and
names (\emph{LATIN CAPITAL H} and \emph{GRINNING FACE}). The code points and names are
unique, though many glyphs may look very similar.

\end{document}
2
  • 1
    It would be nice to add the error or why it failed, so people who don't have access to Latex software can guide you to the right direction.
    – CroCo
    Commented Oct 13, 2017 at 1:57
  • You probably just need to load a font that supports this glyph. Commented Feb 19 at 10:23

2 Answers 2

2

According to the answer here: How would I go about adding Unicode Emoticons into LateX? "DejaVu Sans" font offers such characters.

You need some modifications like not adding the emoticon in '\texttt'

Full code:

\documentclass[9pt]{memoir}
\usepackage[Latin,Greek,Emoticons]{ucharclasses}
\usepackage{fontspec}

\newfontfamily\mydef{DejaVu Sans}
\setDefaultTransitions{\mydef}{}
\newfontfamily\mynormal{Linux Libertine O}
\setTransitionsForLatin{\mynormal}{}
\newfontfamily\mygreek{GFS Artemisia} 
\setTransitionsForGreek{\mygreek}{}

\begin{document}

The standard
consists of various documents or charts that map \emph{code points} (hexadecimal
numbers such as \texttt{0048} or \texttt{1F600}) to glyphs (such as \texttt{H} or 😀), and
names (\emph{LATIN CAPITAL H} and \emph{GRINNING FACE}). The code points and names are
unique, though many glyphs may look very similar. Ελληνικά εδώ!

\end{document}

Result:

enter image description here

3
  • Spoke too soon. My mono fonts are messed up now. Seems to be ignoring my \setmonofont[Scale=0.9]{Source Code Pro} in my lstlisting sections Commented Oct 13, 2017 at 4:18
  • If this doesn't solve your problem anymore, please update your question with the needed parts of code (or ask a new one).
    – koleygr
    Commented Oct 13, 2017 at 11:04
  • 1
    It solves my original question. I asked about the other issue here tex.stackexchange.com/questions/395948/… Commented Oct 13, 2017 at 13:28
0

I'd also give a try to coloremoji.sty (Specifically this fork). It is basically a map between every unicode emoji character found in your document and a database of PDFs per emoji. In comparison to xelatexemoji.sty, you don't have to create yourself the PDFs from a list of SVGs - the PDFs are bundled with the repository.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .