Skip to contents



  input = NULL,
  path = NULL,
  output_format = c("bib", "json", "xml", "ref"),
  overwrite = FALSE



Vector of file paths to the text documents containing bibliographic references, or a single string of reference(s). If input is not a file, it is written to a temporary file for parsing.


The path where the parsed file(s) will be saved. If NULL, files are saved in the current working directory. If empty, the parsed data is returned directly and not saved.


Desired output format, one of "bib", "json", "xml" or "ref". "ref" is a text file with one reference per line. Default is "json".


Logical; if TRUE, existing files at the output location will be overwritten. Default is FALSE.


If path is empty, returns a list (or a single element if only one input) containing the parsed references in the specified format. If path is specified, parsed files are saved at the location and the function returns NULL.


This function utilizes the anystyle Ruby gem to parse bibliographic references. It segments references (one per line) and converts them into structured formats. The input can be

  • the paths of one or several text documents containing one full reference per line.

  • a character vector with each element of the vector containing one full reference.


if (FALSE) {
# Parse a single reference and return as JSON
  input = "Doe, J. Title of the Article. Journal Name 2020, 13, 123-456.",
  output_format = "json"

# Parse references from a file and save as BibTeX
  input = "path/to/references.txt", path = "path/to/output",
  output_format = "bib"