Increment a sequencer

increment

Use the variable increment syntax to add 1 to a sequencer.

Syntax

The syntax for incrementing a sequencer is to use two plus-signs ++ immediately after a variable name.

$varname++
Incrementing a sequencer

Sequencers are variables that hold a numeric value.

A sequencer may be used any place a variable may be used. Most commonly though, sequencers are used within a composition's section headers (h1, h2, h3, etc.) and within table captions and figure figcaptions.

How to define a sequencer

There are two ways that sequencers can be defined.

The simplist way is to use variable assigment syntax, like $CHAP=1.

The alternate way is to use the !var pragma, like this:

!var *varname=CHAP *format=ROMAN

Using the !var pragma method automatically initializes the sequencer to the value "0". It also allows you to define how the sequence value will be formatted when it is compiled into the document. The possible formats are:

digits
two-digits
three-digits
four-digits
roman
ROMAN
alpha
ALPHA
greek
GREEK
numeric-greek
NUMERIC-GREEK
abjad
hebrew

Examples

!var *varname=PART *format=ROMAN
!var *varname=CH *format=digits
!var *varname=SEC *format=alpha

main {
h1 Part $PART++
section {
h2 Chapter $CH++
h3 Section $CH.$SEC=1
h3 Section $CH.$SEC++
}
section {
h2 Chapter $CH++
h3 Section $CH.$SEC=1
h3 Section $CH.$SEC++
}
h1 Part $PART++
}
Using sequence increment syntax

syntax > variables > incrementIncrement a sequencer

Q