Create and register bibstyle JSSextra
register_JSSextra.Rd
Create and register bibstyle JSSextra.
Details
register_JSSextra
creates style "JSSextra"
and registers
it for use in the current R session. This means that it can be
specified for functions which accept a bibstyle argument, most notably
printing objects from class "bibentry"
and
"bibentryExtra"
. In normal use register_JSSextra
is
called once in a session.
Functions accepting a bibstyle argument use a default style if such an
argument is not provided. In most cases it is "JSS"
.
Using tools::bibstyle()
the default style can be changed at any
time to any of the styles currently registered in the session. A list
of these styles can be obtained with
tools::getBibstyle(TRUE)
. The currently default style can be
seen with tools::getBibstyle()
. As a convenience
register_JSSextra(TRUE)
makes and registers "JSSextra"
as the default style.
The remaining arguments should rarely be needed in normal circumstances.
register_JSSextra
stores the bibstyle object it creates and
just uses it when called again. reset = TRUE
can be used to
force a fresh copy of "JSSextra"
to be created.
By default "JSSextra"
is derived from "JSS"
. To base it
on a different style, use argument parent_style
.
Value
register_JSSextra
is used mainly for the side effect of
registering and setting the style as default. It returns the created
style (an environment) but it can be discarded.
Examples
## current default style
tools::getBibstyle()
#> [1] "JSSextra"
tools::getBibstyle(TRUE) # all styles, currently "JSS" only
#> [1] "JSS" "JSSextra"
register_JSSextra() # register "JSSextra"
#> <environment: 0x55b9e3b5d430>
tools::getBibstyle(TRUE) # now it is available
#> [1] "JSS" "JSSextra"
tools::getBibstyle() # ... but not default
#> [1] "JSSextra"
register_JSSextra(TRUE) # this makes it default
#> <environment: 0x55b9e3b5d430>
tools::getBibstyle()
#> [1] "JSSextra"
## setting default style with bibstyle():
tools::bibstyle("JSS", .default = TRUE)
#> <environment: 0x55b9e3b5d430>
tools::getBibstyle()
#> [1] "JSS"