View source: R/cff_read_bib_text.R
| cff_read_bib_text | R Documentation |
cff_ref_lst objectConvert a character representing a BibTeX entry to a
cff_ref_lst object.
cff_read_bib_text(x, encoding = "UTF-8", ...)
x |
A vector of |
encoding |
Encoding to be assumed for |
... |
Arguments passed on to |
This is a helper function that writes x to a *.bib file and reads it with
cff_read_bib().
This function requires bibtex (>= 0.5.0) and uses
bibtex::read.bib().
An object of classes cff_ref_lst, cff according to the
definitions.references specified in
the Citation File Format schema.
Each element of the cff_ref_lst object would have classes
cff_ref, cff.
cff_read_bib() for reading *.bib files.
Other functions for working with BibTeX format:
as_bibentry(),
cff_read(),
cff_write_bib(),
encoded_utf_to_latex()
Other functions for reading external files:
cff_read()
if (requireNamespace("bibtex", quietly = TRUE)) {
x <- c(
"@book{einstein1921,
title = {Relativity: The Special and the General Theory},
author = {Einstein, Albert},
year = 1920,
publisher = {Henry Holt and Company},
address = {London, United Kingdom},
isbn = 9781587340925
}",
"@misc{misc-full,
title = {Handing out random pamphlets in airports},
author = {Joe-Bob Missilany},
year = 1984,
month = oct,
note = {This is a full MISC entry},
howpublished = {Handed out at O'Hare}
}"
)
cff_read_bib_text(x)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.