Learn R Programming

RefManageR (version 1.4.0)

ReadBib: BibLaTeX/BibTeX .bib file parser

Description

Parser for bibliography databases in the bib format containing either BibLaTeX or BibTeX entries.

Usage

ReadBib(
  file,
  .Encoding = "UTF-8",
  header = if (length(preamble)) paste(preamble, sep = "\n") else "",
  footer = "",
  check = BibOptions()$check.entries
)

Arguments

file

string; bib file to parse.

.Encoding

encoding

header

header of the citation list. By default this is made from the Preamble entries found in the bib file.

footer

footer of the citation list.

check

“error”, “warn”, or logical FALSE. What action should be taken if an entry is missing required fields? FALSE means no checking is done, “warn” means entry is added with an error. “error” means the entry will not be added. See BibOptions.

Author

McLean, M. W., based on code in bibtex package by Francois, R.

See Also

read.bib in package bibtex

Examples

Run this code
bib.text <- "@Manual{mclean2014,
  author = {Mathew William McLean},
  title = {Straightforward Bibliography Management in R Using the RefManager Package},
  note = {arXiv: 1403.2036 [cs.DL]},
  year = {2014},
  url = {https://arxiv.org/abs/1403.2036},
}"
tfile <- tempfile(fileext = ".bib")
writeLines(bib.text, tfile)
ReadBib(tfile)
unlink(tfile)
if (FALSE) {
    file.name <- system.file("Bib", "RJC.bib", package="RefManageR")
    bib <- ReadBib(file.name)
}

Run the code above in your browser using DataLab