# How can I use new unicode characters?

I know, there are lots of questions about Unicode and I've read a lot of these. But I wasn't able to solve my problem:

I have to use the characters ↊ and ↋ (U+218A and U+218B) in my text. I tried with LaTeX and XeLaTeX and several packages. But it always sais

! Package inputenc Error: Unicode char ↊ (U+218A)(inputenc) not set up for use with LaTeX.See the inputenc package documentation for explanation.Type H for immediate help....

What can I try? How can I set it up for use? I'm using Texmaker on windows 10 with MikTeX. Thanks!

• Do you have a font that contains these characters? Without a font to display it you get an error message. Jun 12 '17 at 16:12
• Could you please provied a MWE (Minimum Working example)? Jun 12 '17 at 16:19
• You wouldn't get this error with xelatex. Jun 12 '17 at 16:38
• Related/duplicate: How can I get UTF8 character
– Werner
Jun 12 '17 at 16:45

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}

\DeclareUnicodeCharacter{218A}{\turnedtwo}
\DeclareUnicodeCharacter{218B}{\turnedthree}

\makeatletter
\DeclareRobustCommand{\turnedtwo}{\make@turned{2}}
\DeclareRobustCommand{\turnedthree}{\make@turned{3}}
\newcommand{\make@turned}[1]{%
\raisebox{\depth}{\scalebox{-1}[-1]{#1}}%
}
\makeatother

\begin{document}

123456789↊↋0

\end{document}


Not sure whether this renders correctly, so I provide also an image of the code.

Output for the test file:

Prompted by comments, here's a version that works with all engines. I only provide the image of the code, because just a few fonts sport the glyph (among them, Fira Code).

• Isn't that just creating a replacement for the actual symbol instead of rendering the correct glyph? The solution works, but it feels like it does not quite address the question (putting some glyph for which there is little font support into a text). Jun 12 '17 at 17:09
• not quite sure what you did there (I guess I'm too new) but it seems to work. These are the actual unicode glyphs so I guess it is the solution. Thanks! Jun 12 '17 at 17:17
• I guess I got it. So you made that typing in the real unicode glyph just turnes a normal 2 or 3? It seems to work. These are'nt the actual unicode glyphs in the final pdf but that could make it work with fonts wo actually don't have these glyphs included. So it works for me. Thanks! Jun 12 '17 at 17:25
• Remark: this solution only works with PDFLaTeX (and not XeTeX etc.) Oct 10 '21 at 7:38

Having just fiddled with another unicode problem, I stumbled on this question and answer.

Here is a variant for XeLaTeX. All the information I needed was actually provided in the other answers (which font to use and the unicode for the characters) ;-)

\documentclass{article}

\usepackage{fontspec}

\newfontfamily{\firacode}{Firacode-Regular.ttf}
\newcommand{\turnedtwo}{\firacode \symbol{"218A}}
\newcommand{\turnedthree}{\firacode \symbol{"218B}}

\begin{document}

\turnedtwo

\turnedthree

\end{document}