2

I would like to put References and Bibliography in two distinct chapters of the book. The "References" are the things actually cited in the text, but the "Bibliography" is just a manually created chapter before or after the References chapter.

So, i would like to write a chapter file bib.qmd like:

# The bibliography

@source1
@source2
@source3
... etc

However, i haven't found a way to obtain the full content using cites, i only get author or number depending on the CSL. Obviously i could write all that content by hand, but i prefer to do it through the corresponding citation.

I have read about including uncited items, and sound like what i want but i need them in a different chapter and not merged within the references.

Im thinking to write a lua filter to run after quarto's citeproc, and somehow reuse the output of citeproc but not sure if this is a viable path.

fulem
  • 85
  • 7
  • So you want to keep the uncited reference in the `bib.qmd` file? – shafee Jan 08 '23 at 08:35
  • @shafee Yes. More in general, i would like to full cite something that is listed in the references.bib file whenever i want, independently if it was cited or not somewhere. – fulem Jan 08 '23 at 20:08
  • Are you open to latex based solution? – shafee Jan 08 '23 at 20:19
  • 1
    Do you mean a solution only for latex output?. I'm looking for an html and pdf solution. – fulem Jan 08 '23 at 20:22

1 Answers1

0

The idea to use a Lua filter is a good one. The biggest challenge is to collect all uncited items. You'd first get the full list of available items with the pandoc.utils.references function, collect all used keys by filtering on all Cite keys, and then use pandoc.utils.citeproc to generate and process a document with the uncited references.

If you have all uncited items in a single .bib file then you could use a pre-existing filter like multibib. Otherwise you might be able to adapt that filter to fit your requirements.

tarleb
  • 19,863
  • 4
  • 51
  • 80
  • I think this could be helpful. Im testing multibib, however im trying the example of the documentation and doesnt work. Metadata `bibliography: main: main-bibliography.bib etc` returns: Field "bibliography" has value main: main-bibliography.bib software: software.bib The value must instead be a string. – fulem Jan 08 '23 at 20:55
  • Even the R studio editor complains that `bibliography: main: main-bibliography.bib ...` must be a string. – fulem Jan 08 '23 at 20:59
  • BTW, im on quarto v1.2.280, pandoc v2.19.2 – fulem Jan 08 '23 at 21:13