7

My document has \usepackage[utf8]{inputenc} in its preamble. I am trying to use the characters U+2713 (check mark) and U+2717 (ballot X), but I get the error:

! Package inputenc Error: Unicode char \u8:✓ not set up for use with LaTeX.

I understand that I could fix this either by loading a font containing these characters, or by using \DeclareUnicodeCharacter. But how do I determine which font (if any) includes these two characters? (More generally, how does one determine for a given character whether any font includes it?)

I have also tried the utf8x package (even though some say that is not a good idea), and it also fails (albeit with a different error message). I am aware that switching to XeTeX or LuaTeX could be a solution, but I'd like to try to get this working with just pdfTeX if that is possible.

  • There are some online source. But they are probably only available through XeTeX/LuaTeX. On the other hand if there only two characters you can do \catcode`\✓=\active\def✓{\includegraphics{...}}. – Symbol 1 Nov 30 '15 at 5:07
12

Package pifont contains the characters (\ding{51} and \ding{55}) and package newunicodechar helps in assigning them to the Unicode slots:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{pifont}
\usepackage{newunicodechar}
\newunicodechar{✓}{\ding{51}}
\newunicodechar{✗}{\ding{55}}

\begin{document}
Check mark: ✓, ballot x: ✗
\end{document}

Result

  • Worked great. Only problem I had was ! Font U/pzd/m/n/10=pzdr at 10.0pt not loadable: Metric (TFM) file not found but I solved that by installing texlive-fonts-recommended (I'm using MacPorts) – Simon Kissane Nov 30 '15 at 9:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.