counter {juicedown} | R Documentation |
Counter factory.
Description
Define a counter with cnt <- counter("type")
. Add cross-referenced label
in your document with cnt$set("ref")
. Refer to "ref" with cnt$get("ref")
.
Usage
counter(label, open = NULL, close = NULL, sep = " ", link = FALSE)
Arguments
label |
character. Default prefix for the counter. |
open |
character. Opening bracket such as "(" or "[" |
close |
character. Closing bracket such as ")" or "]" |
sep |
character. Separator between label and counter. |
link |
logical. If TRUE, get() method returns a counter surrounded by a tag, linked to the referenced id. |
Value
List of functions to set and get counters with label.
Examples
cnt <- counter("Quiz")
cnt$set("aaa")
cnt$set()
cnt$set("bbb", quiet = TRUE)
cnt$get("aaa")
cnt$get("bbb")
cnt$get("aaa", type = "bare")
cnt$dump()
[Package juicedown version 0.1.1 Index]