Issue #1660 led me to look for a way to include uncited works in a book bibliography, which I am doing by including a text file with the relevant bibtex keys in the #refs div. (A seemingly equivalent approach is to cite those works in a .hidden div.) However, that led to a problem in which citations and the bibliography may not be properly synchronized.

I am not sure of precisely when the problem will occur, but here is a way to produce one circumstance in which it occurs:

- In RStudio, create a new book project.
- Add 2 more Knuth works to the references.bib file. Assume that, in addition to the May 1984 journal article included in the default book project, he had a two-volume technical report put out through ABC Institution called "More Literate Programming", where Volume 1 came out in June 1984 and Volume 2 came out in July 1984. Assume the bibliographic software (Zotero in my case) assigned bibtex keys knuth84b and knuth84a to Volumes 1 and 2 respectively. For my testing purposes I put Volume 2 into the file before Volume 1 but I don't know if that ordering is important. The references.bib file will now look like the code block copied further below.
- Cite Volume 2 (knuth84a) in intro.qmd (in addition to the existing cite of the journal article), but do not cite Volume 1. The relevant line in intro.qmd will now be:

`See @knuth84 and @knuth84a for additional discussion of literate programming.`

- Put the bibtex keys for all 3 works (journal article and 2-volume technical report) in a separate text file, to help implement my workaround to allow a full bibliography in a book. (I would create this file programmatically by reading the references.bib file.) I call the file "all_cited_and_uncited_works.txt". It will look like this:
```
@knuth84
@knuth84a
@knuth84b
```
- Render the book. I do this via "quarto render" from the terminal.




# references.bib file as revised

```
@article{knuth84,
  author = {Knuth, Donald E.},
  title = {Literate Programming},
  year = {1984},
  issue_date = {May 1984},
  publisher = {Oxford University Press, Inc.},
  address = {USA},
  volume = {27},
  number = {2},
  issn = {0010-4620},
  url = {https://doi.org/10.1093/comjnl/27.2.97},
  doi = {10.1093/comjnl/27.2.97},
  journal = {Comput. J.},
  month = may,
  pages = {97–111},
  numpages = {15}
}

@techreport{knuth84a,
  author = {Knuth, Donald E.},
  title = { {{More Literate Programming}} {{Volume}} 2},
  year = {1984},
  month = july,
  institution = {{ABC Institution}}
}

@techreport{knuth84b,
  author = {Knuth, Donald E.},
  title = { {{More Literate Programming}} {{Volume}} 1},
  year = {1984},
  month = june,
  institution = {{ABC Institution}}
}
```

jjallaire
2022-08-04T11:10:56Z
donboyd5
closed
Citations not properly synchronized with bibliography in certain cases
https://github.com/quarto-dev/quarto-cli/issues/1675