Functionality for representing and manipulating bibliographic information in enhanced BibTeX style.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
bibentry(bibtype, textVersion = NULL, header = NULL, footer = NULL, key = NULL, ..., other = list(), mheader = NULL, mfooter = NULL) ## S3 method for class 'bibentry' print(x, style = "text", .bibstyle, ...) ## S3 method for class 'bibentry' format(x, style = "text", .bibstyle = NULL, citation.bibtex.max = getOption("citation.bibtex.max", 1), bibtex = length(x) <= citation.bibtex.max, sort = FALSE, macros = NULL, ...) ## S3 method for class 'bibentry' sort(x, decreasing = FALSE, .bibstyle = NULL, drop = FALSE, ...) ## S3 method for class 'citation' print(x, style = "citation", ...) ## S3 method for class 'citation' format(x, style = "citation", ...)
a character string with a BibTeX entry type. See Entry Types for details.
a character string with a text representation of
the reference to optionally be employed for printing. It is
recommended to leave this unspecified if
a character string with optional header text.
a character string with optional footer text.
a character string giving the citation key for the entry.
a list of arguments as in
a character string with optional “outer” header text.
a character string with optional “outer” footer text.
an object inheriting from class
an optional character string specifying the print style. If present, must be a unique abbreviation (with case ignored) of the available styles, see Details.
logical, passed to
a character string naming a bibliography style.
logical indicating if bibtex code should be given
additionally; currently applies only to
logical indicating if bibentries should be sorted, using
a character string or an object with already loaded Rd macros, see Details.
logical used as
The bibentry objects created by
bibentry can represent an
arbitrary positive number of references. One can use
combine bibentry objects, and hence in particular build a multiple
reference object from single reference ones. Alternatively, one can
bibentry to directly create a multiple reference object by
“vectorizing” the given arguments, i.e., use character vectors
instead of character strings.
a mixture of plain text and BibTeX as traditionally used for citations
R code (
and a simple copy of the
textVersion elements (style
"latex" styles make use
.bibstyle argument using the
function. In addition, one can use the
macros argument to
provide additional (otherwise unknown, presumably LaTeX-style) Rd
macros, either by giving the path to a file with Rd macros to be
loadRdMacros, or an object with macros
When printing bibentry objects in citation style, a
footer for each item can be displayed as well as
mfooter for the whole vector of references.
method which provides the same styles, and for formatting as R code
a choice between giving a character vector with one
call for each bibentry (as commonly used in ‘CITATION’ files), or
a character string with one collapsed call, obtained by combining the
individual calls with
c() if there is more than one bibentry.
This can be controlled by setting the option
FALSE (default) or
TRUE, respectively. (Printing in R
style always collapses to a single call.) Further, for the
format()'s optional argument
citation.bibtex.max (with default
getOption("citation.bibtex.max") which defaults to 1)
determines for up to how many citation bibentries text style is shown
together with bibtex, automatically.
It is possible to subscript bibentry objects by their keys (which are
used for character subscripts if the names are
There is also a
toBibtex method for direct conversion to
bibentry produces an object of class
"bibentry" objects, which are modeled
after BibTeX entries. The entry should be a valid BibTeX entry type,
An article from a journal or magazine.
A book with an explicit publisher.
A part of a book, which may be a chapter (or section or whatever) and/or a range of pages.
A part of a book having its own title.
An article in a conference proceedings.
Technical documentation like a software manual.
A Master's thesis.
Use this type when nothing else fits.
A PhD thesis.
The proceedings of a conference.
A report published by a school or other institution, usually numbered within a series.
A document having an author and title, but not formally published.
... argument of
bibentry can be any number of
BibTeX fields, including
The address of the publisher or other type of institution.
The name(s) of the author(s), either as a
person object, or as a character string which
as.person correctly coerces to such.
Title of a book, part of which is being cited.
A chapter (or section or whatever) number.
The DOI (https://en.wikipedia.org/wiki/Digital_Object_Identifier) for the reference.
Name(s) of editor(s), same format as
The publishing institution of a technical report.
A journal name.
Any additional information that can help the reader. The first word should be capitalized.
The number of a journal, magazine, technical report, or of a work in a series.
One or more page numbers or range of numbers.
The publisher's name.
The name of the school where a thesis was written.
The name of a series or set of books.
The work's title.
A URL for the reference. (If the URL is an expanded DOI, we recommend to use the doi field with the unexpanded DOI instead.)
The volume of a journal or multi-volume book.
The year of publication.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
## R reference rref <- bibentry( bibtype = "Manual", title = "R: A Language and Environment for Statistical Computing", author = person("R Core Team"), organization = "R Foundation for Statistical Computing", address = "Vienna, Austria", year = 2014, url = "https://www.R-project.org/") ## Different printing styles print(rref) print(rref, style = "Bibtex") print(rref, style = "citation") print(rref, style = "html") print(rref, style = "latex") print(rref, style = "R") ## References for boot package and associated book bref <- c( bibentry( bibtype = "Manual", title = "boot: Bootstrap R (S-PLUS) Functions", author = c( person("Angelo", "Canty", role = "aut", comment = "S original"), person(c("Brian", "D."), "Ripley", role = c("aut", "trl", "cre"), comment = "R port, author of parallel support", email = "[email protected]") ), year = "2012", note = "R package version 1.3-4", url = "https://CRAN.R-project.org/package=boot", key = "boot-package" ), bibentry( bibtype = "Book", title = "Bootstrap Methods and Their Applications", author = as.person("Anthony C. Davison [aut], David V. Hinkley [aut]"), year = "1997", publisher = "Cambridge University Press", address = "Cambridge", isbn = "0-521-57391-2", url = "http://statwww.epfl.ch/davison/BMA/", key = "boot-book" ) ) ## Combining and subsetting c(rref, bref) bref bref["boot-book"] ## Extracting fields bref$author bref$author bref$author$email ## Convert to BibTeX toBibtex(bref) ## Format in R style ## One bibentry() call for each bibentry: writeLines(paste(format(bref, "R"), collapse = "\n\n")) ## One collapsed call: writeLines(format(bref, "R", collapse = TRUE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.