TransWikia.com

Change Bibliography "Date accessed:dd.mm.yy" appearance

TeX - LaTeX Asked by mayool on February 10, 2021

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}%
  newunitnewblock
  usebibmacro{byauthor}%
  newunitnewblock
  usebibmacro{byeditor+others}%
  newunitnewblock
  printfield{version}%
  newunit
  printfield{note}%
  newunitnewblock
  printlist{organization}%
  newunitnewblock
  iftoggle{bbx:eprint}
    {usebibmacro{eprint}}
    {}%
  newunitnewblock
  usebibmacro{url+urldate}% from Biblatex's standard.bbx
  newunitnewblock
  usebibmacro{addendum+pubstate}%
  setunit{bibpagerefpunct}newblock
  usebibmacro{pageref}%
  newunitnewblock
  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?

One Answer

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}addcolonspace#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).

Answered by moewe on February 10, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP