bibtex_writer: bibtex writer

View source: R/bibtex_writer.R

bibtex_writerR Documentation

bibtex writer

Description

bibtex writer

Usage

bibtex_writer(z, key = NULL)

Arguments

z

an object of class handl; see handl for more

key

(character) optional bibtex key to use. if NULL we attempt try the following fields in order: key, identifier, id, doi. if you pass in ouput from bibtex_reader() you're likely to have a key field, but otherwise probably not

Value

an object of class BibEntry

See Also

Other writers: cff_writer(), citeproc_writer(), codemeta_writer(), rdf_xml_writer(), ris_writer(), schema_org_writer()

Other bibtex: bibtex_reader()

Examples

(z <- system.file('extdata/citeproc.json', package = "handlr"))
(tmp <- citeproc_reader(z))
bibtex_writer(z = tmp)
cat(bibtex_writer(z = tmp), sep = "\n")

# give a bibtex key
cat(bibtex_writer(tmp, "foobar89"), sep = "\n")

# many at once
if (requireNamespace("bibtex", quietly=TRUE)) {
(z <- system.file('extdata/bib-many.bib', package = "handlr"))
out <- bibtex_reader(x = z)
bibtex_writer(out)
}

ropensci/handlr documentation built on April 26, 2022, 7:37 a.m.