R: Create BibTeX entries from a package

cff_extract_to_bibtex {cffr} | R Documentation

## Create BibTeX entries from a package

### Description

Extract the information of a package to BibTeX. This is done by creating a `cff` object with `cff_create()` and extracting the corresponding entries with `cff_to_bibtex()`.

### Usage

    cff_extract_to_bibtex(x, what = "preferred")

### Arguments

`x` | The source that would be used for generating the `cff` object. It could be: A missing value. That would retrieve the DESCRIPTION file on your in-development package. An existing `cff` object, The name of an installed package (`"jsonlite"`), or Path to a DESCRIPTION file (`"*/DESCRIPTION*"`).
`what` | Fields to extract. The value could be: `preferred`: This would create a single entry with the main citation info of the package. `references`: Extract all the entries on `references`. `all`: A combination of the previous two options. This would extract both the preferred citation info and the references.

### Value

A `bibentry` object or a list of `bibentry` objects. This could be parsed to BibTeX using `toBibtex()`

### See Also

Other bibtex: `cff_to_bibtex()`, `encoded_utf_to_latex()`, `write_bib()`

### Examples

    jsonvalidate <- cff_extract_to_bibtex("jsonvalidate")

    jsonvalidate

    toBibtex(jsonvalidate)

    lite <- cff_extract_to_bibtex("jsonlite", "references")

    lite

    toBibtex(lite)

[Package cffr version 0.2.1 Index]