0

I'm working on a paper main.tex with a separate Bibtex file references.bib. I compile with:

lualatex main
bibtex main
lualatex main

(Note that I must use bibtex because the journal style is not compatible with biber)

In the last step 'lualatex main', I obtain the error String contains an invalid utf-8 sequence which comes from a reference in the Bibtex file: one of the authors names starts with character Á (the error does not happen if this character is removed).

I'm confused: the character seems to be valid utf-8, and it prints without any issue if it's inside the main document. Additionally my Bibtex file contains other uncommon accentuated characters which are displayed normally in the pdf.

What am I missing?


Sorry, I omitted to show the offending entry in the bibtex file:

@book {walsh15,
      author = {Walsh, Kieran and Carney, Gemma M. and Ní Léime, Áine},
      title = "Ageing through Austerity: Critical Perspectives from Ireland",
      year = "2015",
      publisher = "Policy Press",
      address = "Bristol, UK",
      isbn = "9781447316251",
      doi = "10.51952/9781447316251",
      url = "https://bristoluniversitypressdigital.com/view/book/9781447316251/9781447316251.xml"
}

and the resulting .bbl entry:

%Type = Book
\bibitem[{Walsh et~al.(2015)Walsh, Carney and Ní~Léime}]{walsh15}
\bibinfo{author}{Walsh, K.}, \bibinfo{author}{Carney, G.M.},
  \bibinfo{author}{Ní~Léime, \C3.}, \bibinfo{year}{2015}.
\newblock \bibinfo{title}{Ageing through Austerity: Critical Perspectives from
  Ireland}.
\newblock \bibinfo{publisher}{Policy Press}, \bibinfo{address}{Bristol, UK}.
\newblock \URLprefix
  \url{https://bristoluniversitypressdigital.com/view/book/9781447316251/9781447316251.xml},
  \DOIprefix\doi{10.51952/9781447316251}.

And here is the error message:

! String contains an invalid utf-8 sequence.
l.362   \bibinfo{author}{Ní~Léime, 
                                   �..}, \bibinfo{year}{2015}.

Erwan
  • 123

2 Answers2

4

bibtex knows nothing about multi-byte encodings so while trying to fine the "Inital letter" of the name it pulls out just one byte of the bytes for Á so ends up with an invalid generated latex .bbl file. {\'A} is the documented bibtex syntax, and keeps everything ascii.

David Carlisle
  • 757,742
3

If you don't want to replace accented characters in the bibliography, I suggest you run bibtexu -- where "u" denotes either unicode or utf8 -- instead of "plain" bibtex.

enter image description here

\documentclass{article}
\begin{filecontents}[overwrite]{mwe.bib}
@book{walsh15,
      author = {Walsh, Kieran and Carney, Gemma M. and Ní Léime, Áine},
      title = "Ageing through Austerity: Critical Perspectives from Ireland",
      year = "2015",
      publisher = "Policy Press",
      address = "Bristol, UK",
      isbn = "9781447316251",
      doi = "10.51952/9781447316251",
      url = "https://bristoluniversitypressdigital.com/view/book/9781447316251/9781447316251.xml"
}
\end{filecontents}

\usepackage[numbers]{natbib} \bibliographystyle{plainnat}

\usepackage{xurl} \begin{document} \cite{walsh15} \bibliography{mwe} \end{document}

Mico
  • 506,678