2

First of all my question: How can I adjust biblatex to show only the year from the date and not to delete the dashes from the ISBN?

Here is my MWE:

BetterBibLaTeX 1.6.6 within Zotero Standalone 4.0 gives me an export of a book like this:

@book{west_introduction_2000,
  edition = {2},
  title = {Introduction to Graph Theory},
  isbn = {978-0-13-014400-3},
  pagetotal = {470},
  timestamp = {2015-11-23T15:45:12Z},
  publisher = {{Prentice Hall}},
  author = {West, Douglas Brent},
  year = {22.08.2000}
}

With the MWE LaTeX document

\documentclass{scrartcl}

\usepackage[style = authoryear, url = false]{biblatex}
\addbibresource{book.bib} 

\begin{document}
\textcite{west_introduction_2000}
\printbibliography
\end{document}

I get the following result: wrong date and isbn

Edit:

Here is the corresponding issue on GitHub.

1

2 Answers 2

4

The ISBN is stripped of its hyphens due to a bug in Biber's new ISBN features (as requested in Automatically validate and format ISBNs) that has already been fixed in version 2.3 (see #89 at the Biber bugtracker on github). Version 2.3 of Biber is currently not available on CTAN, but as a developer/testing version on sourceforge.

The second problem is related to a malformed year field. It can only hold a year (or rather everything you write in there will be considered the year), entire dates can be specified in the date field where the correct input format is YYYY-MM-DD (with leading zeroes if needed)

date = {2000-08-22}

If you need your malformed year fields to work now and out of the box, you can use the following sourcemap as a temporary relief

\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      \step[fieldsource=year, match=\regexp{([0-9]{2}).([0-9]{2}).([0-9]{4})}, final]
      \step[fieldset=date, fieldvalue={$3-$2-$1}]
      \step[fieldset=year, null]
    }
  }
}

This will match year fields in DD.MM.YYY format and writes the correctly formatted date in YYYY-MM-DD format to the date field. It then clears the year field to avoid confusion.

Of course, the code will only work for the specific problem in your MWE above; if you have year fields with even weirder formats, you will have to think of another ad-hoc solution to address those as well.

MWE

\documentclass{scrartcl}

\usepackage[style = authoryear, url = false]{biblatex}

\usepackage{filecontents}
\begin{filecontents*}{\jobname.bib}
@book{west_introduction_2000,
  edition = {2},
  title = {Introduction to Graph Theory},
  isbn = {978-0-13-014400-3},
  pagetotal = {470},
  publisher = {{Prentice Hall}},
  author = {West, Douglas Brent},
  year = {22.08.2000}
}
\end{filecontents*}

\addbibresource{\jobname.bib}


\DeclareSourcemap{
  \maps[datatype=bibtex]{
    \map{
      \step[fieldsource=year, match=\regexp{([0-9]{2}).([0-9]{2}).([0-9]{4})}, final]
      \step[fieldset=date, fieldvalue={$3-$2-$1}]
      \step[fieldset=year, null]
    }
  }
}

\begin{document}
\textcite{west_introduction_2000}
\printbibliography
\end{document}
3
  • I was wondering when I saw the date in the year field, but I was not able to change it. So I thought Biber should handle it. Is it a problem with BetterBib(La)TeX?
    – Dirk
    Dec 4, 2015 at 10:22
  • @Dirk Yes, I would be tempted to say this is a problem with your export tool. biblatex and Biber expect the year to only contain the year of publication and the date field to have a YYYY-MM-DD format; in fact I believe there aren't even (m)any (?) BibTeX .bst styles that can cope with the year field containing the entire date. Biber can actually convert those malformed year fields into proper date fields, but that should be considered a temporary kludge, while the real issue is been addressed. (See the edited answer, please.)
    – moewe
    Dec 4, 2015 at 16:32
  • Thanks! I will create an issue on BetterBibLaTeX at GitHub, because this is an issue of BetterBibLaTeX.
    – Dirk
    Dec 4, 2015 at 16:49
2

The real BibLaTeX experts will need to chime in on the ISBN, but for the date, that biblatex file is wrong: It should have

date = {2000-08-22}

instead of that year entry and that's what I get from Zotero/Better BibLaTex. So make sure that you are 1) Using the latest version of Better BibLaTeX 2) Selecting Better BibTeX's own BibLaTeX export format ("Better BibLaTeX")

and this should come out correctly.

5
  • I use a fresh installation of Zotero 4.0 and BetterBib(La)TeX 1.6.6. When I export my collection, I select the Format BetterBibLaTeX and get the result above. Are the versions correct? Is an option in Zotero wrong? Is it a bug in BetterBibLaTeX?
    – Dirk
    Dec 4, 2015 at 10:20
  • versions sound right, so may well be a bug, though I'm not getting it w the same versions. Do you get the same issue with Zotero's own BibLaTeX export? In Zotero, do you see the letters d m y behind the date?
    – adam.smith
    Dec 4, 2015 at 14:41
  • Here is the output from Zotero's BibLaTeX: @book{west_introduction_2000, edition = {2}, title = {Introduction to Graph Theory}, isbn = {978-0-13-014400-3}, pagetotal = {470}, publisher = {Prentice Hall}, author = {West, Douglas Brent}, date = {2000-08-22} } This looks good. I see the d m y behind the date.
    – Dirk
    Dec 4, 2015 at 15:00
  • ask the BBT developer then, seems like something is going wrong there. He has details on how to submit errors on his github page and is super-responsive.
    – adam.smith
    Dec 4, 2015 at 18:29
  • I added the corresponding link to my question directly after I opened the issue on GitHub.
    – Dirk
    Dec 5, 2015 at 16:43

You must log in to answer this question.

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