10

I have the problem that I use the citation manager Citavi and it can only export in the format urldate = {dd.mm.yyyy}. However Bibtex needs the format urldate = {yyyy-mm-dd}. It is not really realistic in my case to change all the dates of my bibliography manually, as I have many entries and after each export I would need to redo it.

For example my bibtex entry looks like this:

@Misc{FAO.2011,
  Title                    = {{FAOSTAT: Food balance sheet}},
  Author                   = {FAO},
  Year                     = {2011},
  Address                  = {Rome},
  Url                      = {http://faostat3.fao.org/download/FB/FBS/E},
  Urldate                  = {15.1.2014}
}

Then I receive following warning, when I compile it with BibTex

Package biblatex Warning: Biber reported the following issues
(biblatex) with 'FAO.2011':
(biblatex) - Datamodel: Entry 'FAO.2011' (literature.bib): Inval
id format '15.1.2014' of date field 'urldate' - ignoring.

Is there any way to change the format of Bibtex that it reads the urldate in format urldate = {dd.mm.yyyy} or can I convert it somehow to urldate = {yyyy-mm-dd}?

I have searched in the internet and haven't found any solution for this problem. It seems to be a specific problem of Citavi. To bad that Citavi is not customizable.

My question is similar to this: Ignore a bibliography field [e.g. "urldate"] for eliminating of biblatex/biber warnings. However, no solution was provided in this topic for my problem, because in this case urldate was not needed and thus just ignored. But I need to give urldate.

  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Feb 19 '15 at 18:07
9

Thanks to Giacomo's feedback, I found another solution for this specific problem:

The problem is somehow more related to Citavi and Citavi is not as clear or transparent as LaTeX. For future reference of other people who might encounter a similar problem: Although Citavi asks to provide the date in the format urldate={dd.mm.yyyy} you can type it in as urldate = {yyyy-mm-dd}. The export does not make any problem. Strangly, by just changing one entry, all the other entries are exported accordingly. My fault not trying it out earlier. I should have tried it out earlier.

  • You could also use sed (stream editor), to edit the files. – ctrl-alt-delor Nov 7 '15 at 22:07
7

If you are using biblatex package you can use

\DeclareSourcemap{
    \maps{
        \map[overwrite]{
            \step[fieldsource=urldate,
            match=\regexp{([0-9]{2})\.([0-9]{2})\.([0-9]{4})},
            replace={$3-$2-$1},
            final]
        }
    }
}

in your preamble to reformat urldate field of input *.bib files.

  • an example of the output for this would be pretty helpful – baxx Sep 26 '18 at 0:55
2

for forcing the formatting in BibTeX, I use the double braces, e.g.:

Urldate  = {{15/01/2014}}

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.