Citing Web Archive URLs in BibLaTeX-APA

· ? cm

Much like the entire internet is affected by link rot, research publications, too, are affected by “reference rot”.1 In order to cite online documents that are already no longer available or to pre-empt their disappearance, it is desirable to add a URL where the content is archived, for instance by the Wayback Machine, archive.ph or others.

While it is possible to do this by adding a new datamodel in BibLaTeX, I figured the eprint field will do just as well and with less hassle.

Creating a custom eprint type

Simply add the following lines into your preamble after loading biblatex:

% Custom archive eprint
\NewBibliographyString{archivedat}
\DefineBibliographyStrings{english}{%
  archivedat = {archived at},
}
\DefineBibliographyStrings{ngerman}{%
  archivedat = {archiviert unter},
}
\DeclareFieldFormat{eprint:archive}{\bibstring{archivedat}\space\url{#1}}

With this, we are defining a new eprinttype with the name archive. Then, we are telling BibLaTeX how to format it using strings we have defined earlier. This makes sure that “Archived at” adapts to our document language. Don’t worry about this being lowercase, as it will be automatically uppercased when following a period.

Here's what it looks like:

Brody, D. (1996). Mosaic Netscape: One Small Step for the Web… Mosaic Netscape. Archived at https://web.archive.org/web/19961102091029/http://desires.com/1.1/Features/netscape.html. http://desires.com/1.1/Features/netscape.html

Looks like BibLaTeX prints the eprint information before the URL, which is not what we want in APA style.1

Placing archive information at the end

We can fix this with a little patching that modifies how @online-type entries are displayed, removing the original eprint information and re-adding it after the DOI/URL. Insert this after the previous snippet:

\usepackage{xpatch}
% Remove original eprint location
\xpatchbibdriver{online}
  {\newunit\newblock
   \usebibmacro{eprint}}
  {}
  {}
  {}
% Add eprint after DOI/URL
\xpatchbibdriver{online}
  {\usebibmacro{doi+url}}
  {\usebibmacro{doi+url}%
   \newunit\newblock
   \usebibmacro{eprint}}
  {}
  {}

This gives us:

Brody, D. (1996). Mosaic Netscape: One Small Step for the Web… Mosaic Netscape. http://desires.com/1.1/Features/netscape.html. Archived at https://web.archive.org/web/19961102091029/http://desires.com/1.1/Features/netscape.html

BibTeX entry for reference
@online{brody1996,
  title = {Mosaic {{Netscape}}: {{One}} Small Step for the {{Web}}…},
  author = {Brody, David},
  date = {1996},
  eprint = {https://web.archive.org/web/19961102091029/http://desires.com/1.1/Features/netscape.html},
  eprinttype = {archive},
  url = {http://desires.com/1.1/Features/netscape.html},
  urldate = {2022-11-17},
  organization = {{Mosaic Netscape}}
}

Usage in Zotero

If you’re using the Better BibTeX extension in Zotero (which I highly recommend if you’re routinely exporting .bib files), you can use the Zotero’s Extra field to add the eprint and eprinttype BibTeX fields. Format the Extra field like this:

tex.eprint: https://web.archive.org/web/…
tex.eprinttype: archive

Any other annotations can go below this.


  1. Davis, R. C. (2016). The future of web citation practices. Behavioral & Social Sciences Librarian, 35(3), 128--134. https://doi.org/10.1080/01639269.2016.1241122 ↩︎ ↩︎