Description Usage Arguments Details Author(s) Examples
Provides the code to create, manipulate, or extract values of counters in a LaTeX or HTML document
1 2 | lazy.counter(counter, value, oldcounter, fn = c("new", "addto", "set", "use",
"value"))
|
counter |
A character(1) giving the name of the counter to be created and/or manipulated |
value |
An integer. For |
oldcounter |
character(1). An optional argument for |
fn |
Selects the LaTeX function to be used |
Counters are used to provide table, figure, and section numbers. After each use of each command, the counter is incremented so that it
can be referred to in later uses. New counters may be defined by users, but several LaTeX environments have default counters that do
not need to be defined. These are part, chapter, section, subsection, subsubsection, paragraph, subparagraph, page, equation,
figure, table, footnote, mpfootnote
. Any of these may be manipulated by lazyWeave
.
Referring to and manipulating counters is done using lazy.counter
. Different actions are achieved by changing the fn
argument.
fn="new"
creates a new counter with name counter
.
fn="addto"
adds value
to the current value of counter
.
fn="set"
changes the current value of counter
to value
.
fn="use"
designates counter
for use in the current environment.
fn="value"
returns the value of counter
. This value isn't printed, but can be useful for doing arithmetic with
counter values.
The HTML counters in counter
are the defaults and will reference global counters
options("html.counter.table") |
options("html.counter.table" |
options("html.counter.table" |
options("html.counter.table" |
options("html.counter.table" |
options("html.counter.table" |
options("html.counter.table"
|
Additional and custom counters may be defined if desired, in which case a new option will be defined as
options("html.custom.[countername]")
.
Extracting a current value does not increment the counter–this must be done manually (and is done manually when used in lazy.table
, lazy.figure
,\
lazy.footnote
, and lazy.section
.
Benjamin Nutter
1 2 3 4 5 6 7 | lazy.counter("myCounter")
lazy.counter("myCounter", value=3, fn="set")
lazy.counter("myCounter", value=2, fn="addto")
lazy.counter("myCounter", fn="use")
lazy.counter("myCounter", fn="value")
lazy.counter("table", fn="use")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.