I have been working on this document without problem, but now everytime I compile it, this message appears:

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


\usepackage[spanish]{babel} %francais, polish, spanish, ...



\author{CONTRATO No. LCC-MPORTO-2016-003}
some text here



%\include{./capitulos/parte 1} 

\addcontentsline{toc}{chapter}{Índice de Figuras}

\addcontentsline{toc}{chapter}{Índice de Cuadros}


  • 1
    Probably, you have changed the editor you use to edit the source file, switching from one which used the ansinew encoding to another that uses a different encoding (most likely, utf8). Please add information concerning hte editors you have been using previously, and the one you are using now.
    – GuM
    Commented Jan 4, 2018 at 15:58
  • 1
    really you should not use ansinew for new documents it was never a standard encoding (and not defined by ANSI) it was just a weirdly named microsoft code page. For new documents you should use utf-8 or (if you want an 8-bit encoding) latin1. Most likely the error is because yor editor has saved yout file in latin1 or utf-8 and not the microsoft "ansinew" encoding. Commented Jan 4, 2018 at 16:08

1 Answer 1


As posted your code is in UTF-8 (as the whole website is UTF-8) and so the accented letters in the title are not understood, as LaTeX is expecting ansinew

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

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

l.2 ...nc@undefined@ {ansinew}ndice de Figuras}{3}


The error comes from the Í when read back for the table of contents.

deleting the corrupt .toc file then specifing


allows the document to run without error

enter image description here

  • 1
    Thanks. I tried your solution (erased the .toc document and specified UTF-8 package) but not it takes forever to compile, and then I get new error messages like this: ! Package inputenc Error: Unicode cha ÓS (U+66) (inputenc) not set up for use with Latex.
    – andrea
    Commented Jan 8, 2018 at 13:29

You must log in to answer this question.

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