# How to Latex without error text with emoji included? [duplicate]

I'm reading output from where users put their own input into a latex document. It appears as though the users can include emojis. So my question, what is then minimal needed so that the following MWE will latex without error. Either the emoji is correctly handled or else ignored or even replaced by some box. The important thing for me is that the document latexs without error.

\documentclass{article}

\begin{document}

Can this be handled in latex?   👍

\end{document}

• how do you compile? with pdflatex or one of the unicode engines? Apr 23 '21 at 15:54
• Compiled with pdflatex Apr 23 '21 at 16:01
• \DeclareUnicodeCharacter{1F44D}{some emoji} Apr 23 '21 at 16:05
• @Geoff Yes, the pdfTeX engine doesn't understand Unicode natively like LuaTeX or XeTeX do, so you have to create the mappings so that it knows what to do with each codepoint Apr 24 '21 at 2:16
• @Geoff perhaps the simplests way to deal with emojis is to use another engine, There are a couple of good enginees developed this century that can be useful for you: xelatex and lualatex. Either of them implies dropping the inputenc and fontenc packages, and replacing them with fontspec aand then use a font with emoji support. Apr 24 '21 at 5:18

\fontfam[LMfonts]
\catcode\👍=13  \def👍{{\emojifont\string👍}}
`