I'm using Beamer with the XeTeX backend and initially I got lots of warnings of the following form:

[WARNING] Missing character: There is no in font [lmmono10-regular]:!

So I went and added \newunicodechar commands for each of them, e.g.


And they all work, I've got almost 30 lines all similar for various Unicode characters. However, this fails for the unicode PRIME character . Once I add the following line:


I start getting the following error:

Error producing PDF.
! TeX capacity exceeded, sorry [input stack size=5000].
\__um_scanprime_collect:N ...canprime_collect:N #1
l.277 ...erTok{→} \DataTypeTok{Set} \OtherTok{_}

I'm using Beamer via Pandoc if that matters.

  • I get no error if unicode-math is not used; I get a different error than stated if I load unicode-math. Anyway, you should do \AtBeginDocument{\newunicodechar{′}{\makebox[\fontcharwd\font`a]{$\prime$}}} – egreg Oct 8 at 12:15

Judging from the error message you're using unicode-math.

The problem is that this package assigns a value to the “active ” at begin document, thus overriding what your \newunicodechar does.

Solution: postpone \newunicodechar.





  • Thanks! I'm not using unicode-math myself, but I guess Pandoc includes it automatically. – Cactus Oct 8 at 13:46

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.