4

I have some error, trying to manage my references.

I am using Mac with Texshop and BibDesk. They both work absolutely fine in english, but when i try something with russian word in .bib file gives that error

./error_example.bbl:25: Package inputenc Error: Invalid UTF-8 byte sequence.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.25 Ð.
       ~Ю.Ð., \emph{ÐÑбОÑеÑкОе ÑПÑÐŒÑ}.\hskip 1em plus 0.5em...

? 

My .bib file looks like that:

%% Saved with string encoding Unicode (UTF-8) 

@book{cubic_forms,
    author = {Манин Ю.И.},
    date-added = {2023-11-14 17:13:52 +0300},
    date-modified = {2023-11-14 17:42:26 +0300},
    publisher = {Наука},
    title = {Кубические формы},
    year = {1972.}}
    

BibDesk saves in UTF-8 format and my code looks like that

\documentclass[12pt]{article}

\usepackage{cmap}
\usepackage[T2A]{fontenc}  
\usepackage[utf8]{inputenc}
\usepackage[english,russian]{babel}

\begin{document}

This is from \cite{cubic_forms}
\bibliographystyle{IEEEtran}
\bibliography{ref.bib}

\end{document}

How can i fix this? Is that a Texshop problem?

UPD: As i can see, i can ignore all that warnings and compile that. Also i figured out, that if i change \bibliographystyle{IEEEtran} to \bibliographystyle{plain} or different styles, it works. IEEEtran was very good style for my because of it's links visualization. Can i fix it without switching to biblatex/biber and changing my programs? Ideally, i would like to keep IEEEtran as bibliographystyle.

UPD2: I discovered, that problem is starting, when IEEEtran translates .bib file to .bbl. Can i add something to make it better?

3
  • 1
    As always on the site, please provide a full bit minimal example that others can copy and test as is. In general I would not expect bibtex to handle UTF8 code correctly. You might want to have a look at biblatex which the biber backend.
    – daleif
    Nov 14, 2023 at 15:07
  • 1
    Given that bibtex sorts on author, a russian name in utf8 will probably not work as bibtex has no idea on how to sort it.
    – daleif
    Nov 14, 2023 at 16:27
  • Note that the code works well using biblatex and biber though I don't know which style is equivalent to IEEEtran.
    – daleif
    Nov 14, 2023 at 16:30

1 Answer 1

4

You can use biblatex with the ieee style.

\begin{filecontents*}{\jobname.bib}
@book{cubic_forms,
    author = {Манин, Ю. И.},
    date-added = {2023-11-14 17:13:52 +0300},
    date-modified = {2023-11-14 17:42:26 +0300},
    publisher = {Наука},
    title = {Кубические формы},
    year = {1972.},
    langid={russian},
}
\end{filecontents*}

\documentclass[12pt]{article}

%\usepackage{cmap}
\usepackage[T2A,T1]{fontenc}  
%\usepackage[utf8]{inputenc}
\usepackage[main=english,russian]{babel}
\usepackage{csquotes}
\usepackage[style=ieee,autolang=other*]{biblatex}
\usepackage{hyperref}

\addbibresource{\jobname.bib}

\begin{document}

This is from \cite{cubic_forms}

\printbibliography

\end{document}

I used filecontents* just to make the example self-contained. Replace \jobname.bib in \addbibresource with the actual name of your bib file.

However, note the fixes in the bib entry: a comma was missing and also a space between the initials.

Run pdflatex, then biber and then pdflatex again.

enter image description here

You must log in to answer this question.

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