0

I have a problem with the encoding of my .bib file. It is most definitely related to this question, however the proposed solution does not work for me and the error message (see below) is slightly different.

The end of my master doc is line 126 and I just changed my .bib file. So it must be definitely the library.

I work with Portuguese spelling so the hyphen is in a lot of my literature entries. Most of them work well and appear in the bibfile e.g. as {\~{A}}

I already tried to go manually trough my literature list and identify the problem, but that did not work out.

Can anybody please help me how to solve or at least debug this in an efficient manner?

! Package inputenc Error: Unicode char ‐ (U+2010)
(inputenc) not set up for use with LaTeX.
See the inputenc package documentation for explanation.
Type H <return> for immediate help.
...
l.126
Your command was ignored.
Type I <command> <return> to replace it with another command,
or <return> to continue without it.
joaoal
  • 111
  • 2
    Welcome to TeX.SX! Try adding this to your preamble: \DeclareUnicodeCharacter{2010}{-} – Phelype Oleinik Jan 17 '20 at 12:10
  • @PhelypeOleinik. Uff glad I found help here so quickly. Thank you very much!!! So actually the error message did reveal which character was the problem. – joaoal Jan 17 '20 at 13:20
  • 1
    Yes, this message always do. The thing is that you are using a Unicode hyphen character (which LaTeX doesn't know by default) rather than the standard ASCII hyphen, so the message looks misleading. Using \DeclareUnicodeCharacter{2010}{-} (and the final - being the ASCII - you type from your keyboard) then LaTeX will know the Unicode one as a synonym of the ASCII one. – Phelype Oleinik Jan 17 '20 at 13:42
  • Would you be OK with closing this as a duplicate of https://tex.stackexchange.com/q/304939/35864? – moewe Jan 17 '20 at 15:44
  • @moewe Sure thing. Please close it.I did not see that one. – joaoal Jan 17 '20 at 15:50

0 Answers0