Work with bibtex references in Rd documentation.
1 2 3
name of the Rd file to update, a character string.
a filename for the updated Rd object.
further arguments to be passed to
an Rd object.
if TRUE, re-insert previously imported references. Otherwise do not change such references.
inspect_Rdbib takes an Rd object and processes the references
as specified below.
The user level function is
rebib. It parses the Rd file
inspect_Rdbib to process the references,
and writes the modified Rd object to file
outfile is missing it is set to the basename of
outfile is the empty string,
outfile is set to
The default Bibtex file is "REFERENCES.bib" in the current working
directory. Arguments "..." can be used to change the name of the bib
file and its location. Argument
bibfile can be used to
overwrite the default name of the bib file. Argument
can be used to specify that the bib file should be taken from the root
of the installation directory of package
get_bibentries for details.
The following scheme can be used for incorporation of bibliographic
references from BibTeX files. Note however, that usually it is more
convenient to use the approach based on Rd macros like
insert_ref and the vignette(s).
The Bibtex key for each reference is put in a comment line in the references section, as in
1 2 3 4 5 6 7 8
At least one space after the colon, ':', is required, spaces before "bibentry:" are ignored.
rebib() on the file, see the example section for a way
rebib() on all files in one go.
Each reference is inserted immediately after the comment line specifying it and a matching comment line marking its end is inserted.
Before inserting a reference, a check for the matching ending line is made, and if such a line is found, the reference is not inserted. This means that to add new references it is sufficient to give their keys, as described above and run the function again. References that are already there will not be duplicated.
The inserted reference may also be edited, if necessary. As long as the two comment lines enclosing it are not removed, the reference will not be overwritten by subsequent calls of the functions described here. Any text outside the markers delineating references inserted by this mechanism is left unchanged, including references inserted by other means.
To include all references from the bib file, the following line can be used:
Notice that there is no space after the colon in this case.
In this case a marker is put after the last reference and the whole
thing is considered one block. So, if the end marker is present and
force is FALSE, none will will be changed. Otherwise, if
force is TRUE, the whole block of references will be removed
and all references currently in the bib file will be inserted.
The main purpose of
bibentry:all is for use in a package
overview file. The reference section in the file "package-package"
promptPackageSexpr uses this feature (but
the user still needs to call
rebib to insert the references).
inspect_Rdbib, the modified Rd object.
rebib is used mainly for the side effect of creating a file
with the references updated. It returns the Rd object created by
parsing and modifying the Rd file.
Georgi N. Boshnakov
insert_ref and the vignette(s) for the recommended way
to import BibTeX references and citations.
1 2 3 4 5 6 7
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.