Skip to contents

Creates a .bib file from a bibentry object(s)

Usage

write_bib(x, file = NULL, append = FALSE, verbose = TRUE, ascii = FALSE)

Arguments

x

A bibentry object created with:

file

Name of the file. If NULL it would display the lines to be written.

append

Whether to append the entries to an existing file or not.

verbose

Display informative messages

ascii

Whether to write the entries using ASCII characters only or not.

Value

Writes an .bib file specified on file parameter and the equivalent Bibtex object created with utils::toBibtex(). It also (invisibly) returns the bibentry object that has been written to the file.

Details

For security reasons, if the file already exists the function would create a backup copy on the same directory.

Examples


bib <- bibentry("Misc",
  title = "My title",
  author = "Fran Pérez"
)

write_bib(bib)
#> @Misc{,
#>   title = {My title},
#>   author = {Fran Pérez},
#> }

write_bib(bib, ascii = TRUE)
#> @Misc{,
#>   title = {My title},
#>   author = {Fran P{\'e}rez},
#> }