4

I use @Article to cite newspaper articles. Occasionally, the time, not just the date, is a crucial element of the entry. However, when I run biber -V I get a warning:

Invalid field 'hour' for entrytype 'article'

How can I record the time of @Article and other entry types? I know I can add note, but I'd like to do it 'properly' (e.g. have it validly sorted).


.tex file:

\documentclass{article}
\usepackage{biblatex}

\addbibresource{DeweyBeatsTruman.bib}

\listfiles

\begin{document}
\textcite{Dewey-beats-Truman}
\end{document}

.bib file:

@Article{Dewey-beats-Truman,
  author = {{Chicago Daily Tribune}},
  title  = {Dewey beats Truman},
  date   = {1948-11-02T23:59:00-06:00},
  journal = {Chicago Daily Tribune},
}

Biber log file after biber -V DeweyBeatsTruman:

[0] Config.pm:354> INFO - This is Biber 2.7
[0] Config.pm:357> INFO - Logfile is '.\DeweyBeatsTruman.blg'
[28] biber-MSWIN64:303> INFO - === 
[51] Biber.pm:359> INFO - Reading '.\DeweyBeatsTruman.bcf'
[124] Biber.pm:835> INFO - Found 1 citekeys in bib section 0
[135] Biber.pm:3670> INFO - Processing section 0
[152] Biber.pm:3840> INFO - Looking for bibtex format file 'DeweyBeatsTruman.bib' for section 0
[155] bibtex.pm:1435> INFO - Decoding LaTeX character macros into UTF-8
[158] bibtex.pm:1292> INFO - Found BibTeX data source 'DeweyBeatsTruman.bib'
[161] Utils.pm:164> WARN - Datamodel: Entry 'Dewey-beats-Truman' (DeweyBeatsTruman.bib): Invalid field 'hour' for entrytype 'article'
[161] Utils.pm:164> WARN - Datamodel: Entry 'Dewey-beats-Truman' (DeweyBeatsTruman.bib): Invalid field 'minute' for entrytype 'article'
[162] Utils.pm:164> WARN - Datamodel: Entry 'Dewey-beats-Truman' (DeweyBeatsTruman.bib): Invalid field 'second' for entrytype 'article'
[162] Utils.pm:164> WARN - Datamodel: Entry 'Dewey-beats-Truman' (DeweyBeatsTruman.bib): Invalid field 'timezone' for entrytype 'article'
[170] UCollate.pm:68> INFO - Overriding locale 'en-US' defaults 'normalization = NFD' with 'normalization = prenormalized'
[170] UCollate.pm:68> INFO - Overriding locale 'en-US' defaults 'variable = shifted' with 'variable = non-ignorable'
[171] Biber.pm:3499> INFO - Sorting list 'nty/global/' of type 'entry' with scheme 'nty' and locale 'en-US'
[171] Biber.pm:3505> INFO - No sort tailoring available for locale 'en-US'
[173] bbl.pm:608> INFO - Writing '.\DeweyBeatsTruman.bbl' with encoding 'ascii'
[174] bbl.pm:712> INFO - Output to .\DeweyBeatsTruman.bbl
[174] Biber.pm:109> INFO - WARNINGS: 4

Output from \listfiles:

 *File List*
 article.cls    2014/09/29 v1.4h Standard LaTeX document class
  size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
biblatex.sty    2016/12/05 v3.7 programmable bibliographies (PK/JW/AB)
pdftexcmds.sty    2016/05/21 v0.22 Utility functions of pdfTeX for LuaTeX (HO)
infwarerr.sty    2016/05/16 v1.4 Providing info/warning/error messages (HO)
ifluatex.sty    2016/05/16 v1.4 Provides the ifluatex switch (HO)
 ltxcmds.sty    2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
   ifpdf.sty    2016/05/14 v3.1 Provides the ifpdf switch
etoolbox.sty    2017/01/02 v2.4 e-TeX tools for LaTeX (JAW)
  keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
kvoptions.sty    2016/05/16 v3.12 Key value format for package options (HO)
kvsetkeys.sty    2016/05/16 v1.17 Key value parser (HO)
etexcmds.sty    2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)
  logreq.sty    2010/08/04 v1.0 xml request logger
  logreq.def    2010/08/04 v1.0 logreq spec v1.0
  ifthen.sty    2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
     url.sty    2013/09/16  ver 3.4  Verb mode for urls, etc.
 xstring.sty    2013/10/13  v1.7c  String manipulations (C Tellechea)
  blx-dm.def
biblatex-dm.cfg
blx-compat.def    2016/12/05 v3.7 biblatex compatibility (PK/JW/AB)
biblatex.def    2016/12/05 v3.7 biblatex compatibility (PK/JW/AB)
standard.bbx    2016/12/05 v3.7 biblatex bibliography style (PK/JW/AB)
 numeric.bbx    2016/12/05 v3.7 biblatex bibliography style (PK/JW/AB)
 numeric.cbx    2016/12/05 v3.7 biblatex citation style (PK/JW/AB)
biblatex.cfg    
 english.lbx    2016/12/05 v3.7 biblatex localization (PK/JW/AB)
DeweyBeatsTruman.bbl
  • What happens if you use 1948-11-02T23:59-06:00Z (note the Z appendage)? – Werner Jan 6 '17 at 7:17
  • 1
    I don't get a warning of that form (indeed, as there is no hour field and as Biber doesn't check for 'extra' fields it would be very odd), though I do get one about the form of the date field (once I add the comma missing in your example). Can you expand the code in the question to a full example and include some details about your system, e.g. version of Biber (from the .blg file), version of biblatex (add \listfiles to your input and find this in the `.log). – Joseph Wright Jan 6 '17 at 7:21
  • I've corrected my copy-paste error. Thanks for being patient. – Hugh Jan 6 '17 at 7:51
  • 1
    Save the following line in a new dbx file like test.dbx and insert the following line \DeclareDatamodelEntryfields[article]{hour,second,minute,timezone}. In your tex file you can use \usepackage[datamodel=test]{biblatex} – Marco Daniel Jan 6 '17 at 13:11
6

It seems as though blx-dm.cfg just misses the fields in the datamodel specification. This causes Biber to fail these fields in the datamodel verification. The fields will still work as expected though. I have reported the issue at the biblatex bug tracker https://github.com/plk/biblatex/issues/523.

To fully enjoy the time fields you need to enable them explicitly with dateusetime=true, note that with the default date=comp times will not be displayed, so I chose date=short instead

\usepackage[date=short,dateusetime=true]{biblatex}

If you want sorting by full date-time, go with

\DeclareSortingScheme{ndtt}{
  \sort{
    \field{presort}
  }
  \sort[final]{
    \field{sortkey}
  }
  \sort{
    \field{sortname}
    \field{author}
    \field{editor}
    \field{translator}
    \field{sorttitle}
    \field{title}
  }
  \sort{
    \field{sortyear}
    \field{year}
  }
  \sort{
    \field{month}
    \literal{0}
  }
  \sort{
    \field{day}
    \literal{0}
  }
  \sort{
    \field{hour}
    \literal{0}
  }
  \sort{
    \field{minute}
    \literal{0}
  }
  \sort{
    \field{sorttitle}
    \field{title}
  }
  \sort{
    \field{volume}
    \literal{0}
  }
}

This does not take into account times zones and will sort entries with missing month before those that have a month (if you change \literal{0} to \literal{99}, that is reversed).

MWE

\documentclass{article}
\usepackage[date=short,dateusetime=true]{biblatex}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@Article{Dewey-beats-Truman1,
  author = {{Chicago Daily Tribune}},
  title  = {B},
  date   = {1948-11-02T23:58:00-06:00},
  journal = {Chicago Daily Tribune},
}
@Article{Dewey-beats-Truman2,
  author = {{Chicago Daily Tribune}},
  title  = {A},
  date   = {1948-11-02T23:59:00-06:00},
  journal = {Chicago Daily Tribune},
}
\end{filecontents*}
\addbibresource{\jobname.bib}

\DeclareSortingScheme{ndtt}{
  \sort{
    \field{presort}
  }
  \sort[final]{
    \field{sortkey}
  }
  \sort{
    \field{sortname}
    \field{author}
    \field{editor}
    \field{translator}
    \field{sorttitle}
    \field{title}
  }
  \sort{
    \field{sortyear}
    \field{year}
  }
  \sort{
    \field{month}
    \literal{0}
  }
  \sort{
    \field{day}
    \literal{0}
  }
  \sort{
    \field{hour}
    \literal{0}
  }
  \sort{
    \field{minute}
    \literal{0}
  }
  \sort{
    \field{sorttitle}
    \field{title}
  }
  \sort{
    \field{volume}
    \literal{0}
  }
}

\ExecuteBibliographyOptions{sorting=ndtt}

\begin{document}
\textcite{Dewey-beats-Truman1,Dewey-beats-Truman2}
\printbibliography
\end{document}

This still produces the warning, but it can safely be ignored.

If you want the warnings gone for now, you will need to create a new .dbx and load that

Save

\DeclareDatamodelEntryfields{month,day,hour,minute,second,timezone,season,endmonth,endday,endhour,endminute,endsecond,endtimezone,endseason}

as time.dbx and add datamodel=time to the loading time options.

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.