3

I just updated to biblatex 3.14 and \DeclareBibliographyAlias seems to have stopped working. I was using it to define a new entry type "reprint" and the following mwe worked with biblatex 3.12 and 3.13:

\documentclass{article}

\begin{filecontents*}[overwrite]{\jobname.bib}
@reprint{foo,
    author = {foo, P.~A.},
    title = {foo},
    year = {2000},
}
\end{filecontents*}

\usepackage{biblatex}
\addbibresource{\jobname.bib}

\DeclareBibliographyAlias{reprint}{customa}

\DeclareBibliographyDriver{reprint}{zzz}

\listfiles

\begin{document}

test

\cite{foo}

\printbibliography

\end{document}

Output with biblatex 2018/11/02 v3.12 :

enter image description here

Output with biblatex 2019/12/01 v3.14 :

enter image description here

1
  • Reading the documentation, the behaviour in the second case is what I'd expect, since you've 'routed' type reprint to the driver for customa. I don't understand what you are trying to achieve with the code. Do you want entries of type reprint to be handled like customa or not? If you do, why declare a driver for reprint at all? If you don't, why make reprint an alias of customa?
    – cfr
    Dec 16 '19 at 17:31
2

Biber 3.14 behaves quite counter-intuitively for unknown entry types, see https://github.com/plk/biber/issues/299: It leaves the entry type empty for unknown types. In the next version of Biber things should be fine again as unknown empty types will just be passed through as-is.


In any case I would argue that the code shown in the MWE was never officially supported.

For one the \DeclareBibliographyAlias{reprint}{customa} is entirely superfluous if it is followed by a \DeclareBibliographyDriver{reprint}{...}. \DeclareBibliographyAlias{reprint}{customa} just tells @reprint entries to use the bibliography driver for @customa entries (which doesn't exist: @customa falls back to the @misc driver). But then \DeclareBibliographyDriver{reprint}{...} defines a driver for @reprint that is used instead.

Secondly, you can only officially use entry types that are defined in the data model. @reprint is not defined in the data model, so using it may lead to undefined behaviour.

If you want to use @reprint as an entry type in its own right, you need to add it to the data model. See How can I create entirely new data types with BibLaTeX/Biber?

\documentclass{article}

\begin{filecontents}{reprint.dbx}
\DeclareDatamodelEntrytypes{reprint}
\DeclareDatamodelEntryfields[reprint]{
  addendum,
  author,
  doi,
  editor,
  editortype,
  eprint,
  eprintclass,
  eprinttype,
  howpublished,
  language,
  location,
  note,
  organization,
  pubstate,
  subtitle,
  title,
  titleaddon,
  type,
  version}
\end{filecontents}

\usepackage[datamodel=reprint]{biblatex}

\DeclareBibliographyDriver{reprint}{zzz}

\begin{filecontents*}[overwrite]{\jobname.bib}
@reprint{foo,
  author = {foo, P.~A.},
  title = {foo},
  year = {2000},
}
\end{filecontents*}
\addbibresource{\jobname.bib}

\begin{document}
\cite{foo}
\printbibliography
\end{document}

For a one-off you can remap @reprint to @customa with a sourcemap and then define the driver with \DeclareBibliographyDriver{customa}{...}.

\documentclass{article}

\usepackage{biblatex}

\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      \step[typesource=reprint, typetarget=customa]
    }
  }
}

\DeclareBibliographyDriver{customa}{zzz}

\begin{filecontents*}[overwrite]{\jobname.bib}
@reprint{foo,
  author = {foo, P.~A.},
  title = {foo},
  year = {2000},
}
\end{filecontents*}
\addbibresource{\jobname.bib}

\begin{document}
\cite{foo}
\printbibliography
\end{document}

For more on \DeclareBibliographyAlias, please have a look at What exactly is the relationship Biblatex refers to as an alias of an entry type? And how should the formatting of aliased entry types be configured?.

I should also note that the code worked in version 3.12 of biblatex (Biber 2.12) but not with earlier versions, since those remapped unknown types to @misc (see https://github.com/plk/biber/issues/242).

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.