I have a very large LaTeX document which can't be compiled because of following error:

Package inputenc Er
ror: Keyboard character used is undefined
(inputenc)                in inputencoding `utf8'.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.

l.1398 \ifcat ^^c0
                  \active \pdf@activecharstrue\fi 

The problem is, I'm not able to find the problematic symbol, because of the document's size.

I wanted to "replace" the character with something different like this


But it doesn't work. Am I doing something wrong or this character simply can't be replaced? Or do you have any other tip how to find the mistake?

I'm using pdflatex.

I've read several other questions, but I've not been able to solve this anyway:


It's this document - I've deleted almost all the text in main.tex and it's still not working...


Ok, the problem is obviously caused by pdfx package. I've tried to move it before inputenc include like this

\RequirePackage[latin1, utf8]{inputenc},

but now it gives me another error:

LaTeX Error: Comm
and \maketitle already defined.
               Or name \end... illegal, see p.192 of the manual.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.

l.235 }
  • 1
    It's on line 1398.
    – cfr
    Nov 25, 2016 at 23:02
  • 1
    @cfr The problem is, document is structured like a lot of small .tex files, so I don't know, which line is it really.
    – Eenoku
    Nov 25, 2016 at 23:03
  • 1
    Then comment stuff out until you find it, I guess. Sometimes, you can grep them, but not always.
    – cfr
    Nov 25, 2016 at 23:20
  • 1
    I guess pdfx should be loaded before inputenc, but the class does the converse.
    – egreg
    Nov 25, 2016 at 23:20
  • 1
    @egreg pdfx is the problem, but it didn't solve it completely. I've added info to my question.
    – Eenoku
    Nov 25, 2016 at 23:27

3 Answers 3


The class file diploma.cls is not well written.

Packages should generally be loaded after \LoadClass. You can just move the \LoadClass declaration at the top. Also pdfx should be loaded before inputenc.

\def\docdate{20. června 2016}
\ProvidesClass{diploma}[\filedate\space \fileversion\space diploma EXPERIMENTAL LaTeX document class]

I don't think the latin1 option to inputenc does anything good. Actually, the package should be loaded in the document and not by the class.


Sometimes is just an copy-paste issue.

Try manually re-writting the problem line.

It happened to me once that I helped a student who had some syntax error on a python line, the line visibly was something like:

variable = [1,2,3].append("text")

then I decided to delete that line, character by character, and it turned out that between the = and the [ characters I had to press 5 times the backspace.

This usually happens when you copy something from a rendered text document, like a PDF file, to your console.


People will tell you not to do it but just delete all root_document.bbl, root_document.out, etc. files (presuming root_document is, well, you root document). Often these files don't update properly even after you removed the problematic character. Just recompile and things will be fine.

You must log in to answer this question.

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