9.5 Placement of the bibliography

If the style calls for a list of works cited, it will be placed in a div with id refs, if one exists:

::: {#refs}
:::

Otherwise, it will be placed at the end of the document. Generation of the bibliography can be suppressed by setting suppress-bibliography: true in the YAML metadata.

If you wish the bibliography to have a section heading, you can set reference-section-title in the metadata, or put the heading at the beginning of the div with id refs (if you are using it) or at the end of your document:

last paragraph...

# References

The bibliography will be inserted after this heading. Note that the unnumbered class will be added to this heading, so that the section will not be numbered.

If you want to put the bibliography into a variable in your template, one way to do that is to put the div with id refs into a metadata field, e.g.

---
refs: |
   ::: {#refs}
   :::
...

You can then put the variable $refs$ into your template where you want the bibliography to be placed.