3

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

1 Answer 1

4

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

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .
https://tex.stackexchange.com/questions/505179/biblatex-custom-fields-are-not-shown
tex.stackexchange.com
CC-MAIN-2024-30
148757
application/http; msgtype=response
sha1:MAMUWMHWLDBGE3J4M44CLG63FKRT4LGR
<urn:uuid:3f6d4813-5572-475d-8e1f-4a1c5fd86060>
2024-07-25T16:26:04Z
172.64.144.30
text/html
sha1:KE73J7YM7DY3YX7TDZHQZSM2MHFUZMMP
<urn:uuid:9160bb3c-6c58-4592-8d26-1a5d38b76aab>
https://tex.stackexchange.com/questions/505179/biblatex-custom-fields-are-not-shown
response
<urn:uuid:3a935e3e-8001-4c08-911b-d23bf7963641>
isPartOf: CC-MAIN-2024-30
publisher: Common Crawl
description: Wide crawl of the web for July 2024
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-67-67-168
software: Apache Nutch 1.20 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 1.5-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/