1

My question is similar to yet different than: How to fix Package inputenc Error: "Unicode char \u8:� not set up for use with LaTeX."?

I'm using TexLive and Texmaker with the elsarticle.cls document class. Bibtex is being used for the references as required by the document class. Because several of the references are in Russian the following is in the preamble:

\usepackage[T1,T2A]{fontenc}% Russian language support
\usepackage[utf8]{inputenc}
%% `Elsevier LaTeX' style
\bibliographystyle{elsarticle-num}

Both the .tex file and the .bib files are in UTF8 encoding (using the command file -I (filename) in terminal on a mac). For some reason when the document is compiled the .bbl file is in unknown encoding. Attempting to declare the unicode characters

\DeclareUnicodeCharacter{2013}{\textendash}

has no effect on the error message being thrown:

! 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.... �.

The line numbers of the error match the lines of the .bbl file generated.

The other clues are that the errors do not happen until the document is compiled with pdflatex, bibtex, and then pdflatex. Further, if the .bib file with the Russian Cyrillic is commented out the error does not happen. The last clue from the terminal on my mac, file -I (filename) shows that the .bbl file is in utf8 when using another document that is in the report document class and uses:

\bibliographystyle{unsrt}

Does anyone have any suggestions on troubleshooting this or a potential fix?

To make an example for yourself, simply download the elsarticle template from here:

and add this to the bib file:

@book{aizenshtata_features_1952,
    address = {Ленинград},
    series = {Главное управление гидрометеорологической службы при Совете Министров СССР. Труды Ташкентской геофизической обсерватории Вып. 6 (7)},
    title = {Some features of the heat balance of the sandy desert (in {Russian}: Некоторые черты теплового баланса песчаной пустыни)},
    abstract = {На обл. только загл. серии, Библиогр.: с. 54-55 (36 назв.)},
    language = {rus},
    publisher = {Гидрометеоиздат},
    author = {Айзенштат, Борис Абрамович},
    collaborator = {Зуев, М. В.},
    year = {1952},
    note = {pgs 3-55},
    keywords = {Пустыни песчаные -- Тепловой баланс},
    file = {3122870.pdf:/Users/nkampy/Library/Application Support/Zotero/Profiles/f12p038d.default/zotero/storage/PRG79WIE/3122870.pdf:application/pdf}
}

@book{kondratyev_transfer_1950,
    address = {Москва; Ленинград},
    title = {Transfer of long-wave radiation in the atmosphere (in Russian: Перенос длинноволнового излучения в атмосфере)},
    abstract = {Библиогр.: с. 285-287 (71 назв.)},
    language = {rus},
    publisher = {Госизд-во техн-теоретлит},
    author = {Кондратьев, Кирилл Яковлевич},
    year = {1950},
    keywords = {Атмосфера -- Лучистый теплообмен -- Определение, Тепловое излучение, длинноволновое -- Перенос и поглощение в атмосфере}
}

@inproceedings{gordov__calculation_1938,
    address = {Ленинград},
    title = {Calculation of direct solar radiation on inclined surfaces differently oriented on the latitude 42{\degree} (in {R}ussian: Расчет прямой солнечной радиации на различно ориентированные наклонные поверхности для широты 42{\degree})},
    booktitle = {Материалы по агроклиматическому районированию субтропиков СССР},
    publisher = {Гидрометеорологическое изд-во},
    author = {{Гордов А.Н.}},
    year = {1938},
    file = {ER16-04761.pdf:/Users/nkampy/Library/Application Support/Zotero/Profiles/f12p038d.default/zotero/storage/TUTQK3QF/ER16-04761.pdf:application/pdf}
}

And add this to the .tex file:

%%%%%% Packages Added By Author %%%%%%
\usepackage[T1,T2A]{fontenc}% Russian language support
\usepackage[utf8]{inputenc}
%\DeclareUnicodeCharacter{2013}{\textendash}
%\DeclareUnicodeCharacter{00A0}{ }
%\DeclareUnicodeCharacter{00A0}{~}
\usepackage[russian,USenglish]{babel}

\usepackage{gensymb}% \degree command

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

and this in the main body after the template citations:

Test references: \cite{aizenshtata_features_1952, kondratyev_transfer_1950, gordov__calculation_1938}

You can see for yourself that the problem is with how the elsarticle article class handles conversion of Cyrillic letters in the names to initials for the bibliography. You can also see that unicode characters are being handled correctly otherwise.

enter image description here

  • 1
    bibtex cannot handle utf8 bib files. You could try processing with bibtex8. – Alan Munn Jun 4 '18 at 23:18
  • That does not appear to be true as the report class example with the unsorted bibtex style does generate a .bbl file that is utf8 from a .bib file that is utf8. – user3780514 Jun 4 '18 at 23:55
  • 1
    @HerbSchulz Possibly not an option if this is a journal, as the class suggests. – cfr Jun 5 '18 at 1:20
  • 1
    Please provide an MWEB. – cfr Jun 5 '18 at 1:20
  • 1
    bibtex is 8-bit. It will handle an ä not as one char but as two: ä. In a lot places this is not a problem and the utf8-chars are simply passed through and you get as output an unbroken working utf8-char. But if such a char is e.g. at the begin of a first name and so used to created an initial or happens to be at a line break bibtex can split it in pieces and then you get errors. – Ulrike Fischer Jun 5 '18 at 8:03
2

The form of the error message shows you have an old version of latex, newer versions give the number. As posted here that question mark is U+fffd (replacement character) but that is usually substituted (perhaps by this site) when there is an encoding error in the file. You could use

\DeclareUnicodeCharacter{FFFD}{????}

which, if it is U+FFFD in your file, will make the error go and looking for ???? in your output will show where the problem is.

  • @ David Carlisle, That won't work as the symbol being shown in the post and on my operating system is not the actual unicode character. To make matters worse, the problem is buried in how the elsarticle document class handles unicode characters for conversion from first and middle names to initials in the bibliography. This means that several Cyrillic characters are being typed as U+2013. I'll make two examples and post them so you have something concrete to look at. – user3780514 Jun 5 '18 at 13:47
0

Misha's answer to this question also worked for me.... All I had to do was change the bibtex compile command from bibtex to bibtexu. Compiling did cause some errors, although they showed no effect on the output.

Cyrillic first names problem with natbib and bibtex

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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