条目类型“文章”的字段小时无效

条目类型“文章”的字段小时无效

我过去常常@Article引用报纸文章。有时,时间(而不仅仅是日期)是条目的关键要素。然而,当我运行时,biber -V我收到一条警告:

条目类型“文章”的字段“小时”无效

我如何记录时间@Article和其它条目类型?我知道我可以添加note,但我想“正确地”添加(例如并对其进行有效排序。


.tex文件:

\documentclass{article}
\usepackage{biblatex}

\addbibresource{DeweyBeatsTruman.bib}

\listfiles

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

.bib文件:

@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 日志文件之后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

输出自\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

答案1

似乎blx-dm.cfg只是遗漏了数据模型规范中的字段。这导致 Biber 在数据模型验证中无法通过这些字段。但这些字段仍将按预期工作。我已在biblatex错误跟踪器上报告了此问题https://github.com/plk/biblatex/issues/523

要充分享受时间字段,您需要使用 明确启用它们dateusetime=true,请注意,默认date=comp时间将不会显示,因此我date=short选择

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

如果您希望按完整日期时间排序,请使用

\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}
  }
}

这不考虑时区,并且会将缺少月份的条目排序在有月份的条目之前(如果更改\literal{0}\literal{99},则相反)。

平均能量损失

\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}

这仍然会产生警告,但可以安全地忽略它。

如果你希望警告暂时消失,你需要创建一个新的.dbx并加载它

节省

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

time.dbx添加datamodel=time到加载时间选项。

相关内容