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,
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?
References
"Stack Overflow", 2022, https://stackoverflow.com/, last accessed on 2022-12-30
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.
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}
:::
accessed
field is still being ignored but urldate
and note
is working as intended.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With