Creates a .bib
file from a bibentry
object(s)
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.
See also
vignette("bibtex_cff", "cffr")
, knitr::write_bib()
and the
following packages:
Other BibTeX helpers:
cff_from_bibtex()
,
cff_to_bibtex()
,
encoded_utf_to_latex()
,
write_citation()
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},
#> }