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}.
 

8
  • 2
    hard to say with no code shown. The most common reason for getting that error is the file does in fact have an incorrectly encoded character. Feb 23 at 15:49
  • 1
    show at least the generated bbl for that entry and the full error from the log which will show the error context Feb 23 at 15:52
  • 2
    bibtex doesn't like utf8 at the begin of name. It tries to split it for the initial. Feb 23 at 16:13
  • 2
    use {\'A} not Á Feb 23 at 17:11
  • 1
    For more information on how to enter "accented" characters in a bib file, please see How to write “ä” and other umlauts and accented letters in bibliography?
    – Mico
    Feb 23 at 18:58

2 Answers 2

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.

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}
2
  • I tested bibtexu for the companion and found to many bugs to include it. Feb 24 at 0:29
  • @UlrikeFischer - It's a real pity that bibtexu isn't up to snuff in terms of bugginess.
    – Mico
    Feb 24 at 12:01

You must log in to answer this question.

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