Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add URL access date in Quarto pdf references

I am trying to add a last accessed field to web references in a Quarto PDF. Here is a minimal example of a qmd file:

---
title: "How to cite a URL with access date"
format: pdf
bibliography: references.bib
---

I am using @stackoverflow1, @stackoverflow2 and @stackoverflow3.

# References

::: {#refs}
:::

This is references.bib:

@online{stackoverflow1,
  title = {Stack Overflow with note},
  url   = {https://stackoverflow.com/},
  year  = {2022},
  note  = {https://stackoverflow.com/, last accessed on 2022-12-30}
}

@online{stackoverflow2,
  title   = {Stack Overflow with urldate},
  url     = {https://stackoverflow.com/},
  year    = 2022,
  urldate = {2022-12-30}
}

@online{stackoverflow3,
  title    = {Stack Overflow with accessed},
  url      = {https://stackoverflow.com/},
  year     = {2022},
  accessed = {2022-12-30}
}

The output is,

enter image description here

As you can see, the note, urldate and accessed fields are all ignored. I have tried using different csl files, e.g. APA and Harvard Educational Review. I have also tried the instructions for doing this in Latex in this and this post. I have also changed @misc to @online. None of these seem to make any difference.

How do you add a date accessed field to a Quarto PDF reference?

Expected output

References

"Stack Overflow", 2022, https://stackoverflow.com/, last accessed on 2022-12-30

like image 500
SamR Avatar asked Sep 20 '25 12:09

SamR


2 Answers

When used with CSL, then urldate is the correct way to add the access date to a reference. The used citation style must support that information, or otherwise it won't be shown. You can go to the citation style repository and search for "accessed" (which is the key used by CSL for this information). This will bring up all styles that include this info in the entry.

https://github.com/citation-style-language/styles/search?q=accessed

Such styles are commonly called "author date styles", so we could also search for those in the Zotero database. To use a style, download it and pass it via the csl metadata key.

like image 157
tarleb Avatar answered Sep 23 '25 00:09

tarleb


You need to tell Quarto to use biblatex using cite-method yaml option.

---
title: "How to cite a URL with access date"
format: pdf
bibliography: references.bib
cite-method: biblatex
biblatexoptions:
  - citestyle = authoryear
---

I am using @stackoverflow1, @stackoverflow2 and @stackoverflow3.

# References

::: {#refs}
:::

URL access date in Quarto pdf references


accessed field is still being ignored but urldate and note is working as intended.

like image 30
Shafee Avatar answered Sep 23 '25 01:09

Shafee