plk / biber

Backend processor for BibLaTeX
Artistic License 2.0
339 stars 38 forks source link

Unknown entry types get empty entry types #299

Closed moewew closed 4 years ago

moewew commented 4 years ago

From https://tex.stackexchange.com/q/520657/35864

Consider the following MWE with an unknown entry type @unknowntype

\documentclass{article}
\usepackage{biblatex}

\begin{filecontents*}[overwrite]{\jobname.bib}
@unknowntype{sigfridsson,
  author       = {Sigfridsson, Emma and Ryde, Ulf},
  title        = {Comparison of methods for deriving atomic charges from the
                  electrostatic potential and moments},
  journaltitle = {Journal of Computational Chemistry},
  date         = 1998,
  volume       = 19,
  number       = 4,
  pages        = {377-395},
  doi          = {10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P},
}
\end{filecontents*}
\addbibresource{\jobname.bib}

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

The .bbl file will contain

\refsection{0}
  \datalist[entry]{nty/global//global/global}
    \entry{sigfridsson}{}{}
      \name{author}{2}{}{%
        {{hash=484061f383fb3b729627e12ab42c1963}{%
           family={Sigfridsson},
           familyi={S\bibinitperiod},
           given={Emma},
           giveni={E\bibinitperiod}}}%
        {{hash=b7e299b632e5db12681c2decc8ce023f}{%
           family={Ryde},
           familyi={R\bibinitperiod},
           given={Ulf},
           giveni={U\bibinitperiod}}}%
      }
      \strng{namehash}{d9015d9f08448ab0cb194bd964d7b44b}
      \strng{fullhash}{d9015d9f08448ab0cb194bd964d7b44b}
      \strng{bibnamehash}{d9015d9f08448ab0cb194bd964d7b44b}
      \strng{authorbibnamehash}{d9015d9f08448ab0cb194bd964d7b44b}
      \strng{authornamehash}{d9015d9f08448ab0cb194bd964d7b44b}
      \strng{authorfullhash}{d9015d9f08448ab0cb194bd964d7b44b}
      \field{sortinit}{S}
      \field{sortinithash}{c319cff79d99c853d775f88277d4e45f}
      \field{labelnamesource}{author}
      \field{labeltitlesource}{title}
      \field{journaltitle}{Journal of Computational Chemistry}
      \field{number}{4}
      \field{title}{Comparison of methods for deriving atomic charges from the electrostatic potential and moments}
      \field{volume}{19}
      \field{year}{1998}
      \field{dateera}{ce}
      \field{pages}{377\bibrangedash 395}
      \range{pages}{19}
      \verb{doi}
      \verb 10.1002/(SICI)1096-987X(199803)19:4<377::AID-JCC1>3.0.CO;2-P
      \endverb
    \endentry
  \enddatalist
\endrefsection
\endinput

i.e. it will give the entry type as an empty string. This is a counter-intuitive result.

I suppose this behaviour comes from the implementation of the case-folding for entry types implemented for https://github.com/plk/biber/issues/278.

Given the discussions in https://github.com/plk/biber/issues/242 I'm not sure which of the following two solutions I would prefer, but I'd say either is preferable to just nulling the entry type

plk commented 4 years ago

Fixed in DEV branch. Unknown types are retained as-is. I never liked the "normalise to @misc" as the chances of that giving the desired output were always slim.

moewew commented 4 years ago

Thank you very much. It looks much better now.