Package 'biblioformat'

Title: Revise and Reformat Plain Text Bibliographies
Description: Revise and reformat reference lists (bibliographies) in plain text format. From a reference list as plain text, biblioformat attempts to retrieve DOIs and metadata from Crossref, and reformat them according to a chosen style (e.g. BibTeX, or following a particular journal citation style).
Authors: Francisco Rodriguez-Sanchez [aut, cre]
Maintainer: Francisco Rodriguez-Sanchez <[email protected]>
License: MIT + file LICENSE
Version: 0.0.3
Built: 2025-01-01 06:38:31 UTC
Source: https://github.com/Pakillo/biblioformat

Help Index


Revise and Reformat a Bibliography

Description

Revise and reformat a list of references provided as plain text. This function will try to identify their DOI (through Crossref), then formatting each following the chosen output format (e.g. BibTeX, or a particular journal style).

Usage

biblioformat(
  refs = NULL,
  output = c("text", "data.frame"),
  format = c("text", "bibtex"),
  style = "apa",
  filename = NULL,
  ...
)

Arguments

refs

A character vector with bibliographic references. If NULL (default), will read them from the clipboard.

output

Return references as plain text (output = "text") or as a data.frame (output = "data.frame")

format

Reference format. Either "text" (default) or "bibtex" that can e.g. be later imported in a reference manager

style

Output style for bibliography when format is "text". Default is "apa", but any of the >9000 styles available in github.com/citation-style-language/styles can be used. See cr_cn for details.

filename

Optional. Save formatted bibliography to a text file.

...

Further arguments for cr_cn.

Value

If output = "text", a character vector with revised and reformatted bibliographic references. These are automatically copied to the clipboard, so they can be directly pasted onto a document. Optionally, if filename is provided, a text file is also saved on disk. If output = "data.frame" a data.frame is returned with the input references, identified DOI, and resulting citation metatada.

Note

Some references may be changed and erroneously confounded with others. Please check the output reference list.

Examples

## Not run: 
refs <- c(
"Hansen et al. (2013) Climate sensitivity, sea level and atmospheric carbon dioxide",
"Davis, M.B. and Shaw, R.G. (2001) Science 292(5517): 673-679"
)

biblioformat(refs)

biblioformat(refs, style = "ecology-letters")
biblioformat(refs, format = "bibtex", filename = "myrefs.bib")

biblioformat(refs, format = "data.frame")


## End(Not run)