powered by
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").
cnt <- counter("type")
cnt$set("ref")
cnt$get("ref")
counter(label, open = NULL, close = NULL, sep = " ", link = FALSE)
List of functions to set and get counters with label.
character. Default prefix for the counter.
character. Opening bracket such as "(" or "["
character. Closing bracket such as ")" or "]"
character. Separator between label and counter.
logical. If TRUE, get() method returns a counter surrounded by a tag, linked to the referenced id.
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()
Run the code above in your browser using DataLab