Create a BibTeX File from a BibEntry Object

Share:

Description

Creates a Bibtex File from a BibEntry object for use with either BibTeX or BibLaTex.

Usage

1
2
WriteBib(bib, file = "references.bib", biblatex = TRUE, append = FALSE,
  verbose = TRUE, ...)

Arguments

bib

a BibEntry object to be written to file

file

character string naming a file, should; end in “.bib”

biblatex

boolean; if TRUE, toBiblatex is used and no conversions of the BibEntry object are done; if FALSE entries will be converted as described in toBibtex.BibEntry.

append

as in write.bib

verbose

as in write.bib

...

additional arguments passed to writeLines

Value

bib - invisibly

Note

To write the contents of bib “as is”, the argument biblatex should be TRUE, otherwise conversion is done as in toBibtex.BibEntry.

Author(s)

McLean, M. W. based on write.bib by Gaujoux, R. in package bibtex.

See Also

write.bib, ReadBib, toBibtex.BibEntry, toBiblatex, BibEntry

Examples

1
2
3
4
5
6
7
8
bib <- ReadCrossRef(query = '10.1080/01621459.2012.699793')
## Write bib if no server error
if (length(bib)){
  tfile <- tempfile(fileext = ".bib")
  WriteBib(bib, tfile, biblatex = TRUE)
  identical(ReadBib(tfile), bib)
  unlink(tfile)
}

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.