避免使用未定义年份的 biber 警告

避免使用未定义年份的 biber 警告

我有一个大bib文件,其中有些条目没有年份。我想避免发出的警告,biber -V 以便我能够将这些条目与真正的警告区分开来。(我并不关心这些条目的出现——它们对我来说看起来不错。)

例如,运行以下命令

\documentclass{article}
\begin{filecontents*}{\jobname.bib}
@Misc{No-date,
    author = {Donald Knuth},
    title = {TeXSuX},
    year = {n.d.},
}

@Misc{Forthcoming,
    author = {Leslie Lamport},
    title = {LaTeX3},
    year = {nodate},
    pubstate = {forthcoming},
}

\end{filecontents*}
\usepackage[style=authoryear-ibid]{biblatex}
\addbibresource{\jobname.bib}

\begin{document}
\nocite{*}
\printbibliography
\end{document}

我进入blg文件:

[126] Utils.pm:164> WARN - year field 'nodate' in entry 'Forthcoming' is not an integer - this will probably not sort properly.
[127] Utils.pm:164> WARN - year field 'n.d.' in entry 'No-date' is not an integer - this will probably not sort properly.

省略字段year仍会返回错误。我注意到biblatex手册在第 4.9.2.14 节中考虑了一种nodate打印方法,但我不知道如何避免与之相关的警告。

答案1

以下内容基于https://github.com/plk/biblatex/issues/480

使用开发版本 Biber 2.8,您可以避免sortyear此警告:

\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@Misc{No-date,
    author = {Donald Knuth},
    title = {TeXSuX},
    year = {n.d.},
    sortyear = 2017
}

@Misc{Forthcoming,
    author = {Leslie Lamport},
    title = {LaTeX3},
    year = {nodate},
    pubstate = {forthcoming},
    sortyear = 2017
}

\end{filecontents*}
\usepackage[style=authoryear-ibid]{biblatex}
\addbibresource{\jobname.bib}

\begin{document}
\nocite{*}
\printbibliography
\end{document}

INFO - This is Biber 2.8 (beta)
INFO - Logfile is 'document.blg'
INFO - Reading 'document.bcf'
INFO - Using all citekeys in bib section 0
INFO - Processing section 0
INFO - Looking for bibtex format file 'document.bib' for section 0
INFO - Decoding LaTeX character macros into UTF-8
INFO - Found BibTeX data source 'document.bib'
INFO - Overriding locale 'en-US' defaults 'normalization = NFD' with 'normalization = prenormalized'
INFO - Overriding locale 'en-US' defaults 'variable = shifted' with 'variable = non-ignorable'
INFO - Sorting list 'nyt/global/' of type 'entry' with scheme 'nyt' and locale 'en-US'
INFO - No sort tailoring available for locale 'en-US'
INFO - Writing 'document.bbl' with encoding 'ascii'
INFO - Output to document.bbl

相关内容