2

I'm trying to add a new entry type with new fields to biblatex. But the fields are not added to the bbl (and so naturally can't be used in the document). I'm probably missing something obvious here, but what?

\begin{filecontents}{ufbibstyle.dbx}
\DeclareDatamodelEntrytypes{uftype}

\DeclareDatamodelFields[type=field,datatype=literal]{uffieldA,uffieldB}

\DeclareDatamodelEntryfields[uftype]{uffieldA,uffieldB}
\end{filecontents}
\begin{filecontents}{ufdbx.bib}
@uftype{testdbx,
uffieldA={A},
uffieldB={B},
titleaddon = {something},
}
\end{filecontents}


\documentclass{article}
\usepackage[datamodel=ufbibstyle]{biblatex}
\DeclareBibliographyDriver{uftype}{% 
  \printfield{uffieldA},\printfield{uffieldB}}
\addbibresource{ufdbx.bib}
\begin{document}
\cite{testdbx}
\printbibliography
\end{document}

The bbl shows then only the titleaddon field:

\refsection{0}
  \datalist[entry]{nty/global//global/global}
    \entry{testdbx}{uftype}{}
      \field{sortinit}{}
      \field{sortinithash}{495dc9894017a8b12cafa9c619d10c0c}
      \field{titleaddon}{something}
    \endentry
  \enddatalist
\endrefsection
2

Apparently, the field names need to be in lowercase. As far as I can see this isn't mentioned in the biblatex manual. I guess it should be (or alternatively biber should be modified to allow for case insensitive field names in the data model).

I opened an issue at https://github.com/plk/biber/issues/278 for this.

MWE

\RequirePackage{filecontents}
\begin{filecontents}{ufbibstyle.dbx}
\DeclareDatamodelEntrytypes{uftype}

\DeclareDatamodelFields[type=field,datatype=literal]{uffielda,uffieldb}

\DeclareDatamodelEntryfields[uftype]{uffielda,uffieldb}
\end{filecontents}
\begin{filecontents}{ufdbx.bib}
@uftype{testdbx,
uffielda={A},
uffieldb={B},
titleaddon = {something},
}
\end{filecontents}


\documentclass{article}
\usepackage[datamodel=ufbibstyle]{biblatex}
\DeclareBibliographyDriver{uftype}{% 
  \printfield{uffielda},\printfield{uffieldb}}
\addbibresource{ufdbx.bib}
\begin{document}
\cite{testdbx}
\printbibliography
\end{document}

MWE output

  • You are a lifesaver, I don't think that I would have realized that this is the problem soon. – Ulrike Fischer Aug 22 at 6:38
  • @UlrikeFischer, it was the only thing I could see was different with working examples! But puzzling, I agree. – David Purton Aug 22 at 7:30
  • If I had made my example smaller and used only one field it would have worked (and puzzled me even more ...) ;-) – Ulrike Fischer Aug 22 at 9:16

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.