0

I am using the nature citation style which unfortunately does not display the date on which I accessed a web page.

Thanks to this post:

urldate=long does not work with nature.bbx style using biblatex

I inserted:

\DeclareBibliographyDriver{online}{% modified from biblatex-nature's bbx
  \usebibmacro{bibindex}%
  \usebibmacro{begentry}%
  \usebibmacro{author/editor+others/translator+others}%
  \setunit{\labelnamepunct}\newblock
  \usebibmacro{title}%
  \newunit
  \printlist{language}%
  \newunit\newblock
  \usebibmacro{byauthor}%
  \newunit\newblock
  \usebibmacro{byeditor+others}%
  \newunit\newblock
  \printfield{version}%
  \newunit
  \printfield{note}%
  \newunit\newblock
  \printlist{organization}%
  \newunit\newblock
  \iftoggle{bbx:eprint}
    {\usebibmacro{eprint}}
    {}%
  \newunit\newblock
  \usebibmacro{url+urldate}% from Biblatex's standard.bbx
  \newunit\newblock
  \usebibmacro{addendum+pubstate}%
  \setunit{\bibpagerefpunct}\newblock
  \usebibmacro{pageref}%
  \newunit\newblock
  \usebibmacro{related}%
  \usebibmacro{finentry}%
}

which allowed me to enable to print the date accessed like so:

(May 30, 2020)

I would like to change to the look of it to something like Harvard style to make clear what this date means:

(Accessed: 21 August 2017)
[Accessed: 21.08.2017]

can someone help me and explain me how I do this?

moewe
  • 175,683
mayool
  • 3

1 Answers1

0

With a current version of biblatex-nature (I checked v1.3c dated 2018/10/18) you won't need the \DeclareBibliographyDriver shown in the question: That code (or indeed a slightly better version of it) is already part of nature.bbx. urldate=long, is enough to show the urldate in full.

If you want to add text like 'accessed' to the urldate, you'll need to modify the urldate field format. You can base your code on the field definition from biblatex.def: \DeclareFieldFormat{urldate}{\mkbibparens{\bibstring{urlseen}\space#1}}.

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}

\usepackage[backend=biber, style=nature, urldate=long]{biblatex}

\DeclareFieldFormat{urldate}{\mkbibparens{\bibstring{urlseen}\addcolon\space#1}}

\DefineBibliographyStrings{english}{ urlseen = {accessed}, }

\addbibresource{biblatex-examples.bib}

\begin{document} \cite{sigfridsson,ctan,markey} \printbibliography \end{document}

CTAN. The Comprehensive TeX Archive Network http://www.ctan.org (accessed: 1st Oct. 2006).

moewe
  • 175,683