5

I received this message when I try to include my bibliography in the document with \printbibliography

! Package inputenc Error: Unicode char \u8:‐ not set up for use with LaTeX.

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

l.174 ...rintbibliography[heading=subbibliography]

I would say the problem is with some character in my .bib file. But if I receive no error message from Biber how do I locate the problematic character?

7
  • At the very least, the .pdf or .dvi of that subbibliography will likely show some funky characters; and it will probably not be in an entry that contains simple, unaccented characters of the Latin alphabet, but something with accents or from other character sets.
    – jon
    Feb 20, 2014 at 6:59
  • @jon it is a very long pdf. Is there anyway to add something like --verbose to LaTeX and then get the problem?
    – Francesco
    Feb 20, 2014 at 7:06
  • It could also be something existent in the bib file, but is not printed to the pdf. Making a miinimal working example will definitely get you to the error, but it might take a while.
    – Johannes_B
    Feb 20, 2014 at 7:13
  • 3
    The problematic character is (U+2010 HYPHEN) as the error states. Simply make a search with your editor for that character in your .bib file. Feb 20, 2014 at 7:28
  • @karlkoeller That worked.
    – Francesco
    Feb 20, 2014 at 8:23

2 Answers 2

8

This kind of problem can be easily resolved.

The package inputenc shows an error that gives you information about the problematic character in your document. In your case it is (U+2010 HYPHEN), and the problematic line is \printbibliography[heading=subbibliography], which means that such character is in your .bib file.

Using the "search and replace" feature of your editor, substitute that character with one recognised by inputenc, e.g. - (U+002D HYPHEN-MINUS) and the problem is solved.

A good editor is usually able to show the Unicode code of the character. If yours is not and you want to know that code, you can find lots of tools in the web for this purpose.

An example is Unicode Character Finder. Paste the character there, and you will get all the needed information on it.

enter image description here

0

A very similar problem was solved in this question: https://stackoverflow.com/questions/13596531/how-to-search-for-non-ascii-characters-with-bash-tools

Look at the answer suggesting

nonascii() { LANG=C grep --color=always '[^ -~]\+'; }

You will be able to see all problematic characters in red and you can add additional grep lines. For example you can ignore UTF-8 in Author, but print it in Pages fields.

You must log in to answer this question.

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