14

I have a large bibliography generated by a reference manager program (Citavi, but it can be anything else). The urldate field of all references is formatted as urldate = {dd.mm.yyyy}, which is not correct for biblatex. However, I don't want to change this field every time I update my HUGE bibliography from the reference manager app. In fact, I receive no errors but many warnings like one below.

Package biblatex Warning: Biber reported the following issues
(biblatex) with 'XYZ.2003':
(biblatex) - Datamodel: Entry 'XYZ.2003' (bibliographie.bib)
: Invalid format '18.11.2013' of date field 'urldate' - ignoring.

I don't want to have these warning, since for many bibliography entries this type of warning will dominate and it will be hard to see the relevant warnings.

I.e. these warnings need to be somehow suppressed

For comleteness (partially using the example Find unused bibkeys using biblatex),

\begin{filecontents*}{bibliograp.bib}
@BOOK{Ab_Steg,
author = "M. Abramowitz and I. A. Stegun",
title = {Handbook of mathematical functions},
publisher = "Dover publications",
year = "1965",
urldate = {15.10.2013},
language="English" }
\end{filecontents*}

\documentclass[11pt,onecolumn,twoside]{scrbook}  
\usepackage[style=numeric-comp,
        backend=biber,      
        date=short,
        firstinits=true,
    language=english]{biblatex}
\AtEveryBibitem{\clearlist{urldate}}
\AtEveryBibitem{\clearlist{abstract}}
\addbibresource[datatype=bibtex]{bibliograp.bib}

\begin{document}
hello world \cite{Ab_Steg}
\printbibliography
\end{document}

As it can be seen, \AtEveryBibitem{\clearlist{urldate}} doesn't prevent the warnings. I also expected that language=german (i.e. go away from the English date standard) in biblatex options could resolve the issue, but it also doesn't help.

3 Answers 3

15

biblatex rightly warns you about a not well-formed field format, so the best solution is to do away with that and use the proper date format yyyy-mm-dd; since you use a citation manager that should be as easy as telling the citation manager to export the date properly (I have no idea how hard that actually is.).

Since you do not want to do this - and since you do not need the urldate field anyway, one solution is to just do away with the field \AtEveryBibitem{\clearfield{urlyear}}, but this of course still issues warnings, because, technically, biber is still processing the field (and still notices it is not well-formed). Note that you don't use \clearfield{urldate} here, because biblatex decomposes date fields into their year, month and day parts - it is enough to delete the year to suppress the output of the field.

To get rid of the errors, we need to prevent biber from seeing the bad field, so we just add

\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map[overwrite=true]{
      \step[fieldset=urldate, null]
    }
  }
}

to our preamble. This will tell biber to discard the urldate field without even properly looking at it.

In my test run this MWE did not complain at all

\begin{filecontents*}{bibliograp.bib}
@BOOK{Ab_Steg,
author = "M. Abramowitz and I. A. Stegun",
title = {Handbook of mathematical functions},
publisher = "Dover publications",
year = "1965",
urldate = {15.10.2013},
language="English" }
\end{filecontents*}

\documentclass[11pt,onecolumn,twoside]{scrbook}  
\usepackage[style=numeric-comp,
        backend=biber,      
        date=short,
        firstinits=true,
    language=english]{biblatex}
\AtEveryBibitem{\clearlist{abstract}}
\addbibresource[datatype=bibtex]{bibliograp.bib}

\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map[overwrite=true]{
      \step[fieldset=urldate, null]
    }
  }
}

\begin{document}
hello world \cite{Ab_Steg}
\printbibliography
\end{document}

One positive effect is that you can get rid of \AtEveryBibitem{\clearfield{urlyear} since that field is ignored further down the road (assuming we're travelling uphill here).

6
  • 2
    Moeve, you are right, it's possible to set up Citavi for Biblatex (and that's very easy, but unfortunately, the option doesn't lie on the surface). So the best solution is really to try to tweak the reference manager app. Dec 19, 2013 at 19:41
  • In addition to AtEveryBibitem, I have found \AtEveryCitekey good to know about, e.g. to suppress the issue from the cite and get Author (date) rather than the less desirable Author (date, issue), you would do \AtEveryCitekey{\clearfield{issue}}.
    – PatrickT
    Jul 9, 2018 at 19:33
  • 1
    @PatrickT The source mapping here is more radical than \AtEveryBibitem or \AtEveryCitekey. Note that issue is rarely the field you want, normally you are looking for number. It is a quirk of biblatex-apa that it shows the issue in the citation label, but apparently that is what the APA dictates.
    – moewe
    Jul 9, 2018 at 20:30
  • Thanks moewe. I had both an issue number and an issue season, e.g. Volume 1, Number 3, Fall 2018. I usually omit season, but if I do include it, the cite comes out as Author (2018, Spring). (I'll have to drop apa soon) I am using issue to store the season because of these remarks in the manual ''This field [issue] is intended for journals whose individual issues are identified by a designation such as ‘Spring’ or ‘Summer’ rather than the month or a number.'' Also, see: tex.stackexchange.com/questions/396421/…
    – PatrickT
    Jul 10, 2018 at 6:18
  • 1
    @PatrickT In that case issue is OK. You could think about using date with 2018-23 instead, but I'm not sure what biblatex-apa makes of that.
    – moewe
    Jul 10, 2018 at 6:36
2

Here is possibly another way for ignoring the warnings; those come from a \warn command in the .bbl file:

$ sed -n '/\\warn/p' my_new_article.bbl 
      \warn{\item Overwriting field 'year' with year value from field 'date' for entry 'author2001paper'}
      \warn{\item Overwriting field 'month' with month value from field 'date' for entry 'author2001paper'}
      \warn{\item Overwriting field 'year' with year value from field 'date' for entry 'author2002paper'}
...

Clearly, if we get rid of these lines, we shouldn't be troubled by the warnings in Latex runs anymore; the above sed statement already prints confirming that our match regex is right; all we need to do is to Delete lines (to newline) and save an in-place replacement of the file:

sed -i '/\\warn/D' my_new_article.bbl

Then when I run pdflatex my_new_article.tex, I don't see those warnings anymore. Of course, this has to be done after each time you've ran biber or bibtex to re-generate the .bbl file (but it could pay off, if you tend to run latex more often than bibtex/biber)

0

I got errors such as

Overwriting field 'month' with month value from field 'date' for entry 'bibtexkey'

Overwriting field 'year' with year value from field 'date' for entry 'bibtexkey'

I silenced them using

\DeclareSourcemap{
 \maps[datatype=bibtex]{
  \map[overwrite=true]{
   \step[fieldset=urldate, null]
   \step[fieldset=month, null]
   \step[fieldset=year, null]
  }
 }
}

In the preamble, but be aware this might remove month and year in your bibliography.

This answer uses info from a post before https://tex.stackexchange.com/a/150723/110064

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .