Search code examples
rlatexpandocquarto

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


Solution

  • 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.