2.1.3 Counters

It is possible to set the initial value of a counter from the command-line using the --counter option or the “counters” section in a configuration file. The configuration file format for setting counters is very simple. The option name in the configuration file corresponds to the counter name, and the value is the value to set the counter to.


The sample configuration above sets the chapter counter to 4, and the part counter to 2.

The --counter can also set counters. It accepts multiple arguments which must be surrounded by square brackets ([ ]). Each counter set in the --counter option requires two values: the name of the counter and the value to set the counter to. An example of --counter is shown below.

plastex --counter [ part 2 chapter 4 ] file.tex

Just as in the configuration example, this command-line sets the part counter to 2, and the chapter counter to 4.

Set initial counter values

Command-Line Options: --counter=[ counter-name initial-value ]
specifies the initial counter values.