4

I'm using Mendeley to create a .bib file for my LaTeX file (I'm using BibLaTeX). In Mendeley I define the field "Date Accessed" for a Web Page as, for example, 18 Sep 2015, so it automatically becomes 2015-09-18. When I export to .bib, it shows urldate = {2015-09-18}. However, when compiled, the bibliography shows "visited on 09/18/2015" (18 is a month that doesn't exist!!).

Strangely, there are other entries that are correct, but I set them exactly the same way, so I'm very confused. In this case, the .bib file shows the urldate in the format {yyyy-dd-mm}, but the output is how I want it (dd-mm-yyyy).

I also tried to force writing in Mendeley 2015-18-09, so that it is the format that BibLaTeX wants, but in that case I get an error saying that the date format is wrong.

Below, you can find an example that shows the correct date (4th Sep 2015) and one that shows the wrong date (18th Sep 2015). Both of them have been input in Mendeley exactly the same way.

@misc{Latitude,
author = {Wikipedia},
file = {:Users/nuri/Library/Application Support/Mendeley Desktop/Downloaded/2e0d0e2cfa61da92bdfb0de9a0276aef68d1ef5b.html:html},
month = sep,
title = {{Latitude}},
url = {https://en.wikipedia.org/wiki/Latitude#Geocentric_latitude},
urldate = {2015-04-09},
year = {2015}
}
@misc{LatLonAlt,
author = {{H. Dana}, Peter},
file = {:Users/nuri/Library/Application Support/Mendeley Desktop/Downloaded/d44961957a5998c59a16ca94005b2ac1a1d715ea.html:html},
institution = {Department of Geography, University of Texas},
month = dec,
title = {{Coordinate Systems Overview}},
url = {http://www.colorado.edu/geography/gcraft/notes/coordsys/coordsys.html},
urldate = {2015-09-18},
year = {1999}
}

Working example: 4th September 2015

Non-working example: it should be 18th September 2015

I know this question is more related to Mendeley, but I just cannot find the answer anywhere. Any help will be appreciated.

  • What option did you give to babel? Can we see a minimal working example to reproduce the issue? – Johannes_B Sep 24 '15 at 15:43
  • This is quite unrelated to Mendeley, but it hinders your work. Get it into biblatex mode somehow. @misc should not be used for online resources, @online is available. Do you really think that Wikipedia is a citeable author? Wikipedia is the name of the project, who provided the information you are citing is probably unknown (a faceless crowd of users). Be careful here. – Johannes_B Sep 24 '15 at 15:45
  • Maybe Formatting dates “day month year” with biblatex can help. – moewe Sep 25 '15 at 10:53
  • 1
    Note that your input urldate = {2015-04-09}, translates to 9. April 2015 and not 4. September 2015, since the input format for date fields in biblatex is always YYYY-MM-DD. As such the output is consistent with the other one, you get a MM/DD/YYYY format in both cases, which makes me think you use American language settings. Switch to Australian, British or change the date format. We can only help you with that if we get to see a full MWE though. – moewe Sep 25 '15 at 11:01
  • @Johannes_B, I didn't use @misc on purpose, it is generated automatically when using "Web Page" on Mendeley. I know that Wikipedia is not the author, this is not my final version and it is within my list of things to do to fix this kind of things. – Zynk Sep 28 '15 at 12:43
3

In the end, I solved the problem by adding the British babel package as suggested, and deleting and adding again some of the entries in Mendeley that had problems with the date no matter how many times I tried to change it.

\documentclass[11 pt, oneside]{report}
\usepackage[british]{babel}
\usepackage{csquotes}
\usepackage[backend=bibtex, citestyle=ieee, bibstyle=ieee]{biblatex}
\addbibresource{library.bib}

\begin{document}

\printbibliography[heading=bibintoc]

\end{document}

Thank you for your contributions.

  • 1
    Note that instead of saying citestyle=ieee, bibstyle=ieee simply style=ieee is shorter and does the same. – moewe Sep 28 '15 at 14:44
  • I just noted that because sometimes you see something far more baffling things along the lines of style=alphabetic, citestyle=authortitle, bibstyle=authoryear-icomp which is terribly confusing and confused. – moewe Oct 1 '15 at 14:27
1

The input format for all date fields in biblatex is always yyyy-mm-dd (with leading zeroes).

So your two urldates are 9 April 2015 for Latitude and 18 September 2015 for LatLonAlt.

You get an output of YYYY/MM/DD, which is biblatex's default for the American locale; the american localisation is also loaded if you don't specify a language or use english.

To change the date format you can switch language with babel to british or australian if you happen to use those dialects.

If you want to stick to American rules and just change the date format, go with

\DefineBibliographyExtras{english}{
  \protected\def\mkbibdateshort#1#2#3{%
    \iffieldundef{#3}
      {}
      {\mkdatezeros{\thefield{#3}}%
       \iffieldundef{#2}{}{/}}%
    \iffieldundef{#2}
      {}
      {\mkdatezeros{\thefield{#2}}%
       \iffieldundef{#1}{}{/}}%
    \iffieldbibstring{#1}{\bibstring{\thefield{#1}}}{\mkdatezeros{\thefield{#1}}}}}

to load the British format for short dates.

If you also want to have the British long date format, you also need

\DefineBibliographyExtras{english}{
  \protected\def\mkbibdatelong#1#2#3{%
    \iffieldundef{#3}
      {}
      {\mkbibordinal{\thefield{#3}}%
       \iffieldundef{#2}{}{\nobreakspace}}%
    \iffieldundef{#2}
      {}
      {\mkbibmonth{\thefield{#2}}%
       \iffieldundef{#1}{}{\space}}%
    \iffieldbibstring{#1}{\bibstring{\thefield{#1}}}{\stripzeros{\thefield{#1}}}}}%

in there.

MWE

\documentclass{article}
\usepackage{filecontents}
\usepackage[backend=biber]{biblatex}

\begin{filecontents*}{\jobname.bib}
@misc{Latitude,
author    = {Wikipedia},
title     = {{Latitude}},
url       = {https://en.wikipedia.org/wiki/Latitude},
urldate   = {2015-04-09},
date      = {2015-09},
}
@online{LatLonAlt,
  author      = {Dana, Peter H.},
  institution = {Department of Geography, University of Texas},
  title       = {Coordinate Systems Overview},
  url         = {http://www.colorado.edu/geography/gcraft/notes/coordsys/coordsys.html},
  urldate     = {2015-09-18},
  date        = {1999-12-15},
}
\end{filecontents*}

\addbibresource{\jobname.bib}
\nocite{*}

\DefineBibliographyExtras{english}{
  \protected\def\mkbibdateshort#1#2#3{%
    \iffieldundef{#3}
      {}
      {\mkdatezeros{\thefield{#3}}%
       \iffieldundef{#2}{}{/}}%
    \iffieldundef{#2}
      {}
      {\mkdatezeros{\thefield{#2}}%
       \iffieldundef{#1}{}{/}}%
    \iffieldbibstring{#1}{\bibstring{\thefield{#1}}}{\mkdatezeros{\thefield{#1}}}}}

\begin{document}
\printbibliography
\end{document}  

enter image description here

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.