Writes a file of the chosen bibliography format
to path
with items belonging to a Zotero user or group library, optionally limited to a specific
collection. Also writes a text file with suffix .version
alongside path
which stores the Zotero library version number and allows for efficient caching.
Usage
zotero_write_bib(
lib_id,
path,
collection_key = NULL,
incl_children = FALSE,
format = "csljson",
force = FALSE,
show_progress = TRUE
)
Arguments
- lib_id
Zotero user or group library identifier. An object as returned by
zoterro::zotero_user_id()
orzoterro::zotero_group_id()
.- path
Path to write the bibliography file to. A character scalar.
- collection_key
Collection key, see
collections()
. IfNULL
, all items in the library are returned.- incl_children
Whether or not to include child items from sub-collections beneath the
collection_key
's or the library's (ifcollection_key = NULL
) top level.- format
Bibliographic data format used for export. One of:
"bibtex"
,"biblatex"
,"csljson"
,"mods"
,"refer"
,"rdf_bibliontology"
,"rdf_dc"
,"rdf_zotero"
,"ris"
,"wikipedia"
For details, see the relevant Zotero documentation.
- force
Whether or not to enforce overwriting the bibliography file regardless of actual changes to the Zotero library since the last export.
- show_progress
Whether or not to output progress indication.
Details
If the Zotero library's content hasn't changed since the last export, nothing will be written to path
and the performed API request will be significantly
faster. See section Caching in zoterro::zotero_api()
for further details.