Difference between revisions of "Command/definecounter"

From ConTeXt wiki
m
m (added Counters' page in "see also" section)
 
Line 26: Line 26:
 
== See Also ==
 
== See Also ==
  
 +
* [[Counters]]
 
* {{cmd|incrementcounter}} - Increase the counter value
 
* {{cmd|incrementcounter}} - Increase the counter value
 
* {{cmd|decrementcounter}} - Decrease the counter value
 
* {{cmd|decrementcounter}} - Decrease the counter value

Latest revision as of 13:42, 22 February 2016

Creates a new numeric counter.

Example

The following partial example adds a picture at the end of each chapter:

\definecounter[EventCount]
  [
    way=bytext,
    prefix=no,
  ]

\startTEXpage
  \incrementcounter[EventCount]
  \externalfigure[{\rawcountervalue[EventCount]}]
                 [
                   height=\paperheight,
                   orientation=90,
                 ]
\stopTEXpage

The pictures are numbered sequentially, starting at 1.

See Also

Source Code

View the source for more details:

http://source.contextgarden.net/tex/context/base/strc-num.mkiv