8

I have problem with code - \RequirePackage[utf8]{inputenc} in my class, i am sure, that this file is fully written in utf8, i tried to convert in multiple way, so it must be in utf8. But still same error. Any tip ? My class - http://pastebin.com/tVRpyZCF and error message -

! Package inputenc Error: Keyboard character used is undefined
(inputenc) in inputencoding `utf8'.
See the inputenc package documentation for explanation.
Type H <return> for immediate help.

I tried to run in with MikTex and in TexLive too but same error. I checked Texmaker enconding, but there is UTF-8 set too..

  • I found solution, u just need to set \RequirePackage[utf8]{inputenc} at the bottom of all require packages... – Lukáš Unzeitig Jan 9 '17 at 15:02
  • 1
    It's a clear bug in pdfx.sty, which says \ifcat^^c0\active where it should of course be \ifcat\noexpand^^c0\active, because if ^^c0 is active to begin with, it will be expanded. – egreg Jan 9 '17 at 15:04
12

It's a bug in pdfx.sty: at line 1398 (where the error message points to) we find

\ifcat^^c0\active \pdf@activecharstrue\fi

Now, when inputenc is loaded with the utf8 encoding, the character ^^c0 is made active. But \ifcat needs to find two unexpandable tokens to which apply the test, so it expands the active character and the error happens.

The line should be

\ifcat\noexpand^^c0\noexpand~\pdf@activecharstrue\fi

so comparing the character token ^^c0 with a character token which indeed has category code 13.

It's a misunderstanding of what \ifcat does: the current test will always give a wrong result, because \active is a control sequence which is not let to a character, so it's considered to have category code 16.

Moving \RequirePackage[utf8]{inputenc} past \RequirePackage{pdfx} will solve your particular issue, but of course the test done by pdfx.sty is completely useless.

  • Thank you very much for your solution and explanation :) !! – Lukáš Unzeitig Jan 10 '17 at 6:28

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.