[Tex/LaTex] Package inputenc Error: Keyboard character used is undefined – ^^c0

errorsinput-encodings

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

/usr/share/texlive/texmf-dist/tex/latex/pdfx/pdfx.sty:1398:
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

\DeclareUnicodeCharacter{^^c0}{?????}

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:


EDIT

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


EDIT 2

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

\RequirePackage[a-1b]{pdfx}
\RequirePackage[latin1, utf8]{inputenc},

but now it gives me another error:

/usr/share/texlive/texmf-dist/tex/latex/base/article.cls:235:
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 }

Best Answer

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\fileversion{9.0}
\def\filedate{2016/06/20}
\def\docdate{20. června 2016}
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{diploma}[\filedate\space \fileversion\space diploma EXPERIMENTAL LaTeX document class]
\LoadClass[11pt]{article}
\RequirePackage[a-1b]{pdfx}
\RequirePackage[latin1,utf8]{inputenc}

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.

Related Question