2

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?

9
  • hex number needs to be uppercase {21AF} Jan 9, 2020 at 11:07
  • I'm using MiKTeX and TexMaker Jan 9, 2020 at 11:07
  • now I get Undefined control sequence. \abs Jan 9, 2020 at 11:09
  • well \abs isn't a standard command, what do you want to define it to do? Jan 9, 2020 at 11:11
  • to print the unicode character 21AF Jan 9, 2020 at 11:11

2 Answers 2

6

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 –

4

Another solution is use a font with that glyph with xelatex:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{FreeSerif}
\begin{document}

↯ ↯ lightning ↯ ↯  and thunder 

\end{document}

mwe

Beside Free fonts, U+21AF slot is also set in a few others fonts, including DejaVu, Symbola, ... WenQuanYi Micro Hei ... and of course Unifont, that unfortunately look like a bitmap font even in the TTF version.

You must log in to answer this question.

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