[Tex/LaTex] ! Package inputenc Error: Unicode character ↯ (U+21AF) (inputenc) not set up for use with LaTeX

input-encodings

The title says it all, I am trying to add the unicode character ↯ (U+21AF) to my code but I get this error. I have been searching for similar questions but none of the answers worked for me.
I have been trying

\usepackage[utf8]{inputenc}
\DeclareUnicodeCharacter{21af}{\abs}

but it did not work. Any ideas?

Best Answer

The hex number needs to be uppercase

 \DeclareUnicodeCharacter{21AF}{\abs}

declares the character ↯ in a source file to produce the command \abs which you then need to define to do whatever you want it to do. the stix package has a command for this so simpler would be

 \DeclareUnicodeCharacter{21AF}{\downzigzagarrow}

But this is to allow you to type a literal ↯ character, if you just want to typeset the character via a tex command you do not need \DeclareUnicodeCharacter just use the stix package and \downzigzagarrow command will be available.

so if you just want a tex command to typeset the arrow you do not need this at all, simply use \downzigzagarrow from the stix package –