You can define a new archiveurl
field with accompanying archivedate
.
This is done via a .dbx
file, we can also add internationalisation. You can read more about this in How can I create entirely new data types with BibLaTeX/Biber? and Add field “tome” to biblatex entries. The .dbx
needs to placed somewhere TeX can find it and its name must be given to biblatex
in the datamodel
option at loading time. In the MWE the file is created automatically using filecontents
.
The .dbx
contains
\DeclareDatamodelFields[type=field, datatype=uri]{archiveurl}
\DeclareDatamodelEntryfields{archiveurl}
\DeclareDatamodelFields[type=field, datatype=date, skipout]{
archivedate,
}
\DeclareDatamodelEntryfields{archivedate}
and thus defines two new fields: archiveurl
and archivedate
. The former is a URI-type field (a URL) while the latter is a date field.
Then we define the needed strings, internationalisation can also be done in an .lbx
file.
\NewBibliographyString{archivedat,archivedon}
\DefineBibliographyStrings{english}{%
archivedat = {archived at},
archivedon = {on},
}
We can define the formats and new macros
\DeclareFieldFormat{archiveurl}{\bibstring{archivedat}\space\url{#1}}
\DeclareFieldFormat{archivedate}{\bibstring{archivedon}\space#1}
\newbibmacro*{archiveurl}{\printfield{archiveurl}}
\newbibmacro*{archivedate}{\printarchivedate}
Finally, we modify the URL macro to also print the archive URL.
\renewbibmacro*{url+urldate}{%
\usebibmacro{url}%
\iffieldundef{urlyear}
{}
{\setunit*{\addspace}%
\usebibmacro{urldate}}%
\setunit{\addcomma\space}%
\usebibmacro{archiveurl}%
\iffieldundef{archiveyear}
{}
{\setunit*{\addspace}%
\usebibmacro{archivedate}}}
Full MWE
\documentclass{article}
\usepackage{filecontents}
\usepackage[british]{babel}
\begin{filecontents*}{archiving.dbx}
\DeclareDatamodelFields[type=field, datatype=uri]{archiveurl}
\DeclareDatamodelEntryfields{archiveurl}
\DeclareDatamodelFields[type=field, datatype=date, skipout]{
archivedate,
}
\DeclareDatamodelEntryfields{archivedate}
\end{filecontents*}
\usepackage[backend=biber,style=authortitle, datamodel=archiving]{biblatex}
\begin{filecontents*}{\jobname.bib}
@article{panic,
author = {Plunkett, John},
title = {Sorrell accuses Murdoch of panic buying},
journal = {The Guardian},
date = {2005-10-27},
url = {http://media.guardian.co.uk/site/story/0,14173,1601858,00.html},
archiveurl = {http://www.webcitation.org/5Kt3PxfFl},
archivedate = {2006-12-04},
}
\end{filecontents*}
\NewBibliographyString{archivedat,archivedon}
\DefineBibliographyStrings{english}{%
archivedat = {archived at},
archivedon = {on},
}
\DeclareFieldFormat{archiveurl}{\bibstring{archivedat}\space\url{#1}}
\DeclareFieldFormat{archivedate}{\bibstring{archivedon}\space#1}
\newbibmacro*{archiveurl}{\printfield{archiveurl}}
\newbibmacro*{archivedate}{\printarchivedate}
\renewbibmacro*{url+urldate}{%
\usebibmacro{url}%
\iffieldundef{urlyear}
{}
{\setunit*{\addspace}%
\usebibmacro{urldate}}%
\setunit{\addcomma\space}%
\usebibmacro{archiveurl}%
\iffieldundef{archiveyear}
{}
{\setunit*{\addspace}%
\usebibmacro{archivedate}}}
\addbibresource{\jobname.bib}
\begin{document}
\nocite{panic}
\printbibliography
\end{document}
url
field. But with a datamodel file it should be possible to add anotherarchivalurl
field. You could also make those archival URLs moreeprint
-like (cf. JSTOR). In fact it is quite easy to extend the currenteprint
scheme even without a datamodel file.