Learn R Programming

bibtex (version 0.5.3)

do_read_bib: Read the raw entries of a bib file

Description

Parses a bib file into its entries without building bibentry objects. This is the parser used by read.bib, exported for packages that process the entries differently.

Usage

do_read_bib(file, encoding = "unknown", srcfile)

Value

A list with one element per entry, leaving out @string,

@preamble and @comment blocks. Each element is a character vector of field values, named by field as written, with the outer braces or quotes removed and the file's @string macros expanded. Its attributes are entry (the entry type as written), key (the citation key) and srcref (the line numbers from the start of the entry up to the next entry or the end of the file). An empty file, or one holding only comments, gives an empty list.

Arguments

file

file name

encoding

encoding

srcfile

Deprecated

Details

The parser is greatly inspired from the bibparse library.

See Also

Examples

Run this code
entries <- do_read_bib(system.file("bib", "xampl_single.bib",
  package = "bibtex"
))
attr(entries[[1]], "key")
entries[[1]][["title"]]

Run the code above in your browser using DataLab