4

I've got several .bib entries like this:

@article{Guinet:Torp,
  author={Louis Guinet},
  title={Les toponymes normands \guillemotleft Torp(s)\guillemotright, \guillemotleft Torpt\guillemotright, \guillemotleft Tourp(s)\guillemotright, \guillemotleft Tour(s)\guillemotright},
  journal={Annales de Normandie},
  volume=30,
  number=2,
  pages="193--197",
  year=1980,
}

but biblatex (or maybe biber) converts them to math mode in the .bbl file:

      \field{title}{{Les toponymes normands {$\guillemotleft$}Torp(s){$\guillemotright$}, {$\guillemotleft$}Torpt{$\guillemotright$}, {$\guillemotleft$}Tourp(s){$\guillemotright$}, {$\guillemotleft$}Tour(s){$\guillemotright$}}}

This is invalid and results in the wrong characters coming out. How do I fix this?

MWE:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[backend=biber]{biblatex}
\bibliography{place_names}
\begin{document}
\cite{Guinet:Torp}
\printbibliography
\end{document}

which gives:

LaTeX Warning: Command \guillemotleft invalid in math mode on input line 7. LaTeX Warning: Command \guillemotright invalid in math mode on input line 7. ! Undefined control sequence. ...{$\guillemotright $}, \guillemotlef \t {T}orpt{$\guillemotrigh...

It used to work on earlier versions of TexLive (I am now using what comes with Ubuntu 16).

  • 1
    Can you show us a full MWE? The conversion depends on the encoding as well as inputenc. – moewe Jul 22 '17 at 10:25
  • I will file a bug report over at the Biber bugtracker. For the time being try and use inputenc, e.g. \usepackage[utf8]{inputenc}. (Make sure your file is encoded in UTF-8.) – moewe Jul 22 '17 at 10:38
  • Thanks - which file has to be utf8? (I've got lots of very large legacy .bib files, and I cannot change them.) – KeithB Jul 22 '17 at 10:40
  • The .tex file should be enough, if your files are ASCII anyway that is fully compatible with UTF-8. So you can say they are UTF-8 without changing anything. If you have non-ASCII chars, more care is needed. – moewe Jul 22 '17 at 10:40
  • See github.com/plk/biber/issues/175 – moewe Jul 22 '17 at 10:41
3

PLK has fixed the issue (https://github.com/plk/biber/issues/175) in the development version Biber 2.8. \guillemots are not converted into math mode any more.

Another possible fix is to use UTF-8 encoding where the guillemots are converted into their respective Unicode chars.

\documentclass{article}
\usepackage[utf8]{inputenc} 
\usepackage[T1]{fontenc}
\usepackage[british]{babel}
\usepackage[style=authoryear]{biblatex}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{Guinet:Torp,
  author={Louis Guinet},
  title={Les toponymes normands \guillemotleft Torp(s)\guillemotright, \guillemotleft Torpt\guillemotright, \guillemotleft Tourp(s)\guillemotright, \guillemotleft Tour(s)\guillemotright},
  journal={Annales de Normandie},
  volume=30,
  number=2,
  pages="193--197",
  year=1980,
}
\end{filecontents}

\addbibresource{\jobname.bib}

\begin{document}
Les toponymes normands \guillemotleft Torp(s)\guillemotright, \guillemotleft Torpt\guillemotright, \guillemotleft Tourp(s)\guillemotright, \guillemotleft Tour(s)\guillemotright

\cite{Guinet:Torp}
\printbibliography
\end{document}

But we established in the comments that that causes trouble with your īs, see Input encoding error after upgrading from Biber 1.9 to Biber 2.1.

You can fix the ī issue with

\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map[overwrite]{
      \step[fieldsource=title,
            match=\regexp{\x{0131}\x{0304}},
            replace=\regexp{ī}]
    }
  }
}
0

These work correctly even in the mode of mathematics with even Version 2.7 (beta) of Biber:

\usepackage{csquotes}

followed by

\flqq

instead of \guillemotleft

and

\frqq

instead of \guillemotright

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.