Releases: adletaw/captioner
Betadiversity 2.2.3
Betadiversity v 2.2.2
Fixes a bug in deprecation message. See also v.2.1.1
Betadiversity v 2.2.1
Maintains deprecated parameters, cite
and num
for backwards compatibility.
Betadiversity v 2.2.0
In this version of captioner
, the option has been added to allow you to define captions without displaying them. This enables you to have more control over the order of caption numbering. It is achieved using a new parameter, display
:
figs <- captioner()
figs("fig1", "caption1", display = FALSE)
The display
parameter also controls how your caption is displayed. The options are:
full
(default): displays the caption with prefix and numbercite
: displays the prefix and number onlynum
: displays the number only
Importantly, the parameters cite
and num
are deprecated in this version.
Betadiversity (v 2.1.0)
This version allows you to display figure (or other object) numbers without the surrounding text. For example, you may have a set of figures that you cite as: "see Figures 1, 2, 3". That can now be done using the num
parameter:
figs <- captioner()
figs("a", num = T)
"1"
If you set both cite
and num
to TRUE
, the num
parameter will override the cite
parameter, showing only the figure number.
Betadiversity (v 2.0)
Version 2.0 introduces hierarchical numbering.
If you want figure numbers with more depth, say if you have a figure with subfigures, or have figure numbers attached to sections, you can implement hierarchical numbering. This will give you, for example, "Figure 1.1.1".
Three new parameters tell captioner
1. how many subsets of numbers you want (levels
), 2. whether you want a number or a character for each (type
), and 3. what you want separating them (infix
). For type
, the choices are "n"
- a number, "c"
- a lowercase character, or "C"
- an uppercase character. If your type
vector is too short, or if you choose not to supply any type
, captioner
will automatically fill in the missing type
s with numbers. The default infix
is .
, but you can choose anything you want.
Normally, a call to your captioner
-generated function will only increment the final number or character in your figure number. If you want to increment an earlier value, there are two ways. First, you can set the parameter level
inside the function. level
gives the number corresponding to which value you want incremented. For example, if you want to bump up from 1.1.1
to 1.2.1
: figs("B", level = 2)
The second way to do this is to use the function bump
, introduced in this version. If you have a document with many chapters or sections, bump
may be more convenient because it is not connected to a specific figure. Instead, you can place it after your section heading, and all subsequent figures will have the bumped up numbering.
bump
takes as parameters your captioner function, and a number indicating which level you want bumped: bump(figs2, level = 1)
Betamax (v 1.2)
Caption storage:
captioner()
will now store your captions. This will allow you to print a caption more than once without typing it again. For example:
> fig_nums <- captioner()
> fig_nums("my_pretty_figure", "my pretty figure's caption")
"Figure 1: my pretty figure's caption"
Now the caption is stored and can be accessed by:
> fig_nums("my_pretty_figure")
"Figure 1: my pretty figure's caption"
Citation order:
captioner()
will now allow you to cite a figure before creating its caption. The ordering of the captions is determined first by citation order, then by caption creation order.
> fig_nums("another_figure", cite = T)
"Figure 2"
> fig_nums("another_figure", "this figure's caption")
"Figure 2: this figure's caption"
Betamax (v 1.1)
Captioner's first official unofficial release.