EVOLUTION-MANAGER
Edit File: bibentry.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Bibliography Entries</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for bibentry {utils}"><tr><td>bibentry {utils}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Bibliography Entries</h2> <h3>Description</h3> <p>Functionality for representing and manipulating bibliographic information in enhanced BibTeX style. </p> <h3>Usage</h3> <pre> 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", ...) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>bibtype</code></td> <td> <p>a character string with a BibTeX entry type. See <b>Entry Types</b> for details. </p> </td></tr> <tr valign="top"><td><code>textVersion</code></td> <td> <p>a character string with a text representation of the reference to optionally be employed for printing. It is recommended to leave this unspecified if <code>format(x, style = "text")</code> works correctly. Only if special LaTeX macros (e.g., math formatting) or special characters (e.g., with accents) are necessary, a <code>textVersion</code> should be provided. </p> </td></tr> <tr valign="top"><td><code>header</code></td> <td> <p>a character string with optional header text.</p> </td></tr> <tr valign="top"><td><code>footer</code></td> <td> <p>a character string with optional footer text.</p> </td></tr> <tr valign="top"><td><code>key</code></td> <td> <p>a character string giving the citation key for the entry.</p> </td></tr> <tr valign="top"><td><code>...</code></td> <td> <p>for <code>bibentry</code>: arguments of the form <code><var>tag</var>=<var>value</var></code> giving the fields of the entry, with <var>tag</var> and <var>value</var> the name and value of the field, respectively. Arguments with empty values are dropped. See <b>Entry Fields</b> for details. </p> <p>For the <code>print()</code> method, extra arguments to pass to the renderer which typically includes the <code>format()</code> method. </p> <p>For the <code>citation</code> class methods, arguments passed to the next method, i.e., the corresponding <code>bibentry</code> one. </p> </td></tr> <tr valign="top"><td><code>other</code></td> <td> <p>a list of arguments as in <code>...</code> (useful in particular for fields named the same as formals of <code>bibentry</code>).</p> </td></tr> <tr valign="top"><td><code>mheader</code></td> <td> <p>a character string with optional “outer” header text.</p> </td></tr> <tr valign="top"><td><code>mfooter</code></td> <td> <p>a character string with optional “outer” footer text.</p> </td></tr> <tr valign="top"><td><code>x</code></td> <td> <p>an object inheriting from class <code>"bibentry"</code>.</p> </td></tr> <tr valign="top"><td><code>style</code></td> <td> <p>an optional character string specifying the print style. If present, must be a unique abbreviation (with case ignored) of the available styles, see <b>Details</b>.</p> </td></tr> <tr valign="top"><td><code>decreasing</code></td> <td> <p>logical, passed to <code><a href="../../base/html/order.html">order</a></code> indicating the sort direction.</p> </td></tr> <tr valign="top"><td><code>.bibstyle</code></td> <td> <p>a character string naming a bibliography style.</p> </td></tr> <tr valign="top"><td><code>citation.bibtex.max</code></td> <td> <p>(<em>deprecated</em>, use <code>bibtex = T|F</code> instead!) a number, say <i>m</i>, indicating that the bibtex code should be given in addition to the formatted tex <em>when</em> there are not more than <i>m</i> entries. The default is taken as <code><a href="../../base/html/options.html">getOption</a>("citation.bibtex.max", 1)</code> which is <code>1</code> typically. For example, to see no bibtex at all, you can change the default by <code><a href="../../base/html/options.html">options</a>(citation.bibtex.max = 0)</code>.</p> </td></tr> <tr valign="top"><td><code>bibtex</code></td> <td> <p>logical indicating if bibtex code should be given additionally; currently applies only to <code>style = "citation"</code>. The default depends on on the number of (bib) entries and <code><a href="../../base/html/options.html">getOption</a>("citation.bibtex.max")</code>.</p> </td></tr> <tr valign="top"><td><code>sort</code></td> <td> <p>logical indicating if bibentries should be sorted, using <code><a href="../../tools/html/bibstyle.html">bibstyle</a>(.bibstyle)$sortKeys(x)</code>.</p> </td></tr> <tr valign="top"><td><code>macros</code></td> <td> <p>a character string or an object with already loaded Rd macros, see <b>Details</b>.</p> </td></tr> <tr valign="top"><td><code>drop</code></td> <td> <p>logical used as <code>x[ ..., drop=drop]</code> inside the <code>sort()</code> method.</p> </td></tr> </table> <h3>Details</h3> <p>The bibentry objects created by <code>bibentry</code> can represent an arbitrary positive number of references. One can use <code>c()</code> to combine bibentry objects, and hence in particular build a multiple reference object from single reference ones. Alternatively, one can use <code>bibentry</code> to directly create a multiple reference object by “vectorizing” the given arguments, i.e., use character vectors instead of character strings. </p> <p>The <code><a href="../../base/html/print.html">print</a></code> method for bibentry objects provides a choice between seven different styles: plain text (style <code>"text"</code>), BibTeX (<code>"Bibtex"</code>), a mixture of plain text and BibTeX as traditionally used for citations (<code>"citation"</code>), HTML (<code>"html"</code>), LaTeX (<code>"latex"</code>), R code (<code>"R"</code>), and a simple copy of the <code>textVersion</code> elements (style <code>"textVersion"</code>). The <code>"text"</code>, <code>"html"</code> and <code>"latex"</code> styles make use of the <code>.bibstyle</code> argument using the <code><a href="../../tools/html/bibstyle.html">bibstyle</a></code> function. In addition, one can use the <code>macros</code> argument to provide additional (otherwise unknown, presumably LaTeX-style) Rd macros, either by giving the path to a file with Rd macros to be loaded via <code><a href="../../tools/html/loadRdMacros.html">loadRdMacros</a></code>, or an object with macros already loaded. </p> <p>When printing bibentry objects in citation style, a <code>header</code>/<code>footer</code> for each item can be displayed as well as a <code>mheader</code>/<code>mfooter</code> for the whole vector of references. </p> <p>The <code><a href="../../base/html/print.html">print</a></code> method is based on a <code><a href="../../base/html/format.html">format</a></code> method which provides the same styles, and for formatting as R code a choice between giving a character vector with one <code>bibentry()</code> call for each bibentry (as commonly used in ‘<span class="file">CITATION</span>’ files), or a character string with one collapsed call, obtained by combining the individual calls with <code>c()</code> if there is more than one bibentry. This can be controlled by setting the option <code>collapse</code> to <code>FALSE</code> (default) or <code>TRUE</code>, respectively. (Printing in R style always collapses to a single call.) Further, for the <code>"citation"</code> style, <code>format()</code>'s optional argument <code>citation.bibtex.max</code> (with default <code><a href="../../base/html/options.html">getOption</a>("citation.bibtex.max")</code> which defaults to 1) determines for up to how many citation bibentries text style is shown together with bibtex, automatically. </p> <p>It is possible to subscript bibentry objects by their keys (which are used for character subscripts if the names are <code>NULL</code>). </p> <p>There is also a <code><a href="toLatex.html">toBibtex</a></code> method for direct conversion to BibTeX. </p> <h3>Value</h3> <p><code>bibentry</code> produces an object of class <code>"bibentry"</code>. </p> <h3>Entry Types</h3> <p><code>bibentry</code> creates <code>"bibentry"</code> objects, which are modeled after BibTeX entries. The entry should be a valid BibTeX entry type, e.g., </p> <dl> <dt>Article:</dt><dd><p>An article from a journal or magazine.</p> </dd> <dt>Book:</dt><dd><p>A book with an explicit publisher.</p> </dd> <dt>InBook:</dt><dd><p>A part of a book, which may be a chapter (or section or whatever) and/or a range of pages.</p> </dd> <dt>InCollection:</dt><dd><p>A part of a book having its own title.</p> </dd> <dt>InProceedings:</dt><dd><p>An article in a conference proceedings.</p> </dd> <dt>Manual:</dt><dd><p>Technical documentation like a software manual.</p> </dd> <dt>MastersThesis:</dt><dd><p>A Master's thesis.</p> </dd> <dt>Misc:</dt><dd><p>Use this type when nothing else fits.</p> </dd> <dt>PhdThesis:</dt><dd><p>A PhD thesis.</p> </dd> <dt>Proceedings:</dt><dd><p>The proceedings of a conference.</p> </dd> <dt>TechReport:</dt><dd><p>A report published by a school or other institution, usually numbered within a series.</p> </dd> <dt>Unpublished:</dt><dd><p>A document having an author and title, but not formally published.</p> </dd> </dl> <h3>Entry Fields</h3> <p>The <code>...</code> argument of <code>bibentry</code> can be any number of BibTeX fields, including </p> <dl> <dt>address:</dt><dd><p>The address of the publisher or other type of institution.</p> </dd> <dt>author:</dt><dd><p>The name(s) of the author(s), either as a <code><a href="person.html">person</a></code> object, or as a character string which <code><a href="person.html">as.person</a></code> correctly coerces to such.</p> </dd> <dt>booktitle:</dt><dd><p>Title of a book, part of which is being cited.</p> </dd> <dt>chapter:</dt><dd><p>A chapter (or section or whatever) number.</p> </dd> <dt>doi:</dt><dd><p>The DOI (<a href="https://en.wikipedia.org/wiki/Digital_Object_Identifier">https://en.wikipedia.org/wiki/Digital_Object_Identifier</a>) for the reference.</p> </dd> <dt>editor:</dt><dd><p>Name(s) of editor(s), same format as <code>author</code>.</p> </dd> <dt>institution:</dt><dd><p>The publishing institution of a technical report.</p> </dd> <dt>journal:</dt><dd><p>A journal name.</p> </dd> <dt>note:</dt><dd><p>Any additional information that can help the reader. The first word should be capitalized.</p> </dd> <dt>number:</dt><dd><p>The number of a journal, magazine, technical report, or of a work in a series.</p> </dd> <dt>pages:</dt><dd><p>One or more page numbers or range of numbers.</p> </dd> <dt>publisher:</dt><dd><p>The publisher's name.</p> </dd> <dt>school:</dt><dd><p>The name of the school where a thesis was written.</p> </dd> <dt>series:</dt><dd><p>The name of a series or set of books.</p> </dd> <dt>title:</dt><dd><p>The work's title.</p> </dd> <dt>url:</dt><dd><p>A URL for the reference. (If the URL is an expanded DOI, we recommend to use the <span class="samp">doi</span> field with the unexpanded DOI instead.)</p> </dd> <dt>volume:</dt><dd><p>The volume of a journal or multi-volume book.</p> </dd> <dt>year:</dt><dd><p>The year of publication.</p> </dd> </dl> <h3>See Also</h3> <p><code><a href="person.html">person</a></code> </p> <h3>Examples</h3> <pre> ## 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 = "ripley@stats.ox.ac.uk") ), 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[2] bref["boot-book"] ## Extracting fields bref$author bref[1]$author bref[1]$author[2]$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)) </pre> <hr /><div style="text-align: center;">[Package <em>utils</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>