2

I'm trying to use the biber backend for biblatex and the author names always come out mangled.

\usepackage[backend=biber,style=numeric]{biblatex}

As a test I'm trying to cite the following article that I put in my .bib file:

@article{einstein,
author =       "Albert Einstein",
title =        "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
[{On} the electrodynamics of moving bodies]",
journal =      "Annalen der Physik",
volume =       "322",
number =       "10",
pages =        "891--921",
year =         "1905",
DOI =          "http://dx.doi.org/10.1002/andp.19053221004",
keywords =     "physics"
}

The resulting entry in the generated reference section shows the author as "_i_iA.E.".

[3] _i_iA. E. “Zur Elektrodynamik bewegter Körper. (German) [On the electrodynamics of moving bodies]”. In: Annalen der Physik 322.10 (1905), pp. 891–921. doi: http : / / dx . doi . org / 10 . 1002 / andp . 19053221004.

All of the entries in my bibliography are similarly mangled. If I change my the backend from biber to bibtex the author displays correctly:

[3] A Einstein. “Zur Elektrodynamik bewegter Körper. (German) [On the electrodynamics of moving bodies]”. In: Annalen der Physik 322.10 (1905), pp. 891–921. doi: http://dx.doi.org/10.1002/andp. 19053221004.

Can someone tell me what the problem is?

EDIT:

It looks like the underscore package is the problem; without it the bibliography looks fine. This example should produce the mangled author name:

\documentclass[10pt,letterpaper]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage{underscore}

\usepackage{filecontents}
\usepackage[backend=biber,sorting=none,style=numeric,citestyle=numeric,bibstyle=numeric]{biblatex}
\addbibresource{example.bib}

\begin{filecontents}{example.bib}
@Article{einstein,
Author =       "A Einstein",
Title =        "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
[{On} the electrodynamics of moving bodies]",
Journal =      "Annalen der Physik",
Volume =       "322",
Number =       "10",
Pages =        "891--921",
Year =         "1905",
DOI =          "http://dx.doi.org/10.1002/andp.19053221004",
keywords =     "physics"
}
\end{filecontents}


\begin{document}

Testing biber~\cite{einstein}.

\printbibliography
\end{document}

The contents of example.blg:

[0] Config.pm:340> INFO - This is Biber 2.4
[0] Config.pm:343> INFO - Logfile is 'example.blg'
[54] biber:287> INFO - === Wed Aug 17, 2016, 16:52:51
[141] Biber.pm:348> INFO - Reading 'example.bcf'
[281] Biber.pm:742> INFO - Found 1 citekeys in bib section 0
[287] Biber.pm:3151> INFO - Processing section 0
[319] Biber.pm:3308> INFO - Looking for bibtex format file 'example.bib' for section 0
[322] bibtex.pm:1113> INFO - Decoding LaTeX character macros into UTF-8
[325] bibtex.pm:974> INFO - Found BibTeX data source 'example.bib'
[353] UCollate.pm:65> INFO - Overriding locale 'en-US' defaults 'variable = shifted' with 'variable = non-ignorable'
[353] UCollate.pm:65> INFO - Overriding locale 'en-US' defaults 'normalization = NFD' with 'normalization = prenormalized'
[354] Biber.pm:3028> INFO - Sorting list 'none/global' of type 'entry' with scheme 'none' and locale 'en-US'
[354] Biber.pm:3032> INFO - No sort tailoring available for locale 'en-US'
[355] bbl.pm:519> INFO - Writing 'example.bbl' with encoding 'UTF-8'
[361] bbl.pm:615> INFO - Output to example.bbl
1
  • 1
    Show the content of your blg-file and a complete example. Commented Aug 17, 2016 at 17:40

1 Answer 1

2

You also get a few errors:

! Missing \endcsname inserted.
<to be read again> 
                   \unhbox 
l.31 \end
         {document}
? 
! Extra \endcsname.
\KV@split ...csname \KV@prefix \@tempa \endcsname 
                                                  \ifx \@tempc \relax \KV@er...
l.31 \end
         {document}
? 
! Missing \endcsname inserted.
<to be read again> 
                   \unhbox 
l.31 \end
         {document}
? 
! Extra \endcsname.
\KV@split ...csname \KV@prefix \@tempa \endcsname 
                                                  \ifx \@tempc \relax \KV@er...
l.31 \end
         {document}

and such errors should not be disregarded.

You can still use underscore, but you need to change the meaning of the active _ so it doesn't break when used in \csname...\endcsname:

\begin{filecontents}{\jobname.bib}
@Article{einstein,
Author =       "A Einstein",
Title =        "{Zur Elektrodynamik bewegter K{\"o}rper}. ({German})
[{On} the electrodynamics of moving bodies]",
Journal =      "Annalen der Physik",
Volume =       "322",
Number =       "10",
Pages =        "891--921",
Year =         "1905",
DOI =          "http://dx.doi.org/10.1002/andp.19053221004",
keywords =     "physics"
}
\end{filecontents}

\documentclass[10pt,letterpaper]{article}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}

\usepackage{underscore}
\AtBeginDocument{%
  \begingroup\lccode`~=`_\lowercase{\endgroup
    \let\usunderscore~%
    \protected\def~{%
    \ifincsname\string_\else\expandafter\usunderscore\fi
  }}%
}

\usepackage[backend=biber,sorting=none,style=numeric,citestyle=numeric,bibstyle=numeric]{biblatex}
\addbibresource{\jobname.bib}


\begin{document}

A_A

Testing biber~\cite{einstein}.

\printbibliography
\end{document}

enter image description here

2
  • 1
    Since the underscore caused quite some problems, the biblatex developer decided to retreat from _ in the .bbl for version 3.5, so the issue should be resolved there (see github.com/plk/biblatex/issues/458).
    – moewe
    Commented Aug 18, 2016 at 6:37
  • As mentioned in my edit, removing the underscore package fixed the problem. So unless the underscore package is really needed, removing it is also an option.
    – Stephan
    Commented Aug 22, 2016 at 15:41

You must log in to answer this question.

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