TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to compile a simple ISO-8859-2 document,



\usepackage[paperwidth=18cm, paperheight=13cm]{geometry}

České vysoké učení technické v Praze

The compilation fails at the "č" letters. It keeps saying

! Package inputenc Error: Keyboard character used is undefined
(inputenc) in inputencoding `latin2'.

despite the fact that "č" is a latin2 character.

share|improve this question
up vote 6 down vote accepted

There seems to be a conflict between the encoding used in your document and the one of your editor. Both encodings: the one declared in your document using inputenc and the one used for your editor need to be the same; otherwise errors will appear. Make sure both coincide and the problem will disappear.

share|improve this answer
Thanks for your answer, but the use of latin2 is mandatory in my project. – Grant May 24 '13 at 1:02
@Grant may I ask why is this so? – Gonzalo Medina May 24 '13 at 1:03
I'll be processing csv files that are in ISO-8859-2. – Grant May 24 '13 at 1:04
@Grant I see. Is your editor configured to also use ISO-8859-2? – Gonzalo Medina May 24 '13 at 1:05
I set it to ISO-8859-2, rewrote the sample and it started working. Thank you. – Grant May 24 '13 at 1:10


% !TEX encoding = UTF-8 Unicode

at the beginning of your document. It works for me.

share|improve this answer
Hello and welcome to TeX.SE! I'm afraid that the fact it works for you does not mean it answers the posted question. I'm actually 100% sure it does not, since the code in the question requires latin1 encoding, and you'd be supplying utf8 to it. – yo' May 1 at 12:11
In LaTeX document? Till to now I was convinced that ones need to write \usepackage[utf8]{inputenc} ... – Zarko May 1 at 12:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.