Difference between revisions of "Command/definecounter"

From Wiki
Jump to navigation Jump to search
m
m
Line 1: Line 1:
 
Creates a new numeric counter.
 
Creates a new numeric counter.
 +
 +
== Example ==
 +
 +
The following partial example adds a picture at the end of each chapter:
 +
 +
<code>
 +
\definecounter[EventCount][
 +
  way=bytext,
 +
  prefix=no
 +
]
 +
 +
\startTEXpage
 +
  \incrementcounter[EventCount]
 +
  \externalfigure[{\rawcountervalue[EventCount]}][
 +
    height=\paperheight,
 +
    orientation=90,
 +
  ]
 +
\stopTEXpage
 +
</code>
 +
 +
The pictures are numbered sequentially, starting at 1.
  
 
== See Also ==
 
== See Also ==
Line 6: Line 27:
 
* {{cmd|decrementcounter}} - Decrease the counter value
 
* {{cmd|decrementcounter}} - Decrease the counter value
 
* {{cmd|rawcounter}} - Retrieve the unformatted value
 
* {{cmd|rawcounter}} - Retrieve the unformatted value
 +
* {{cmd|rawcountervalue}} - Retrieve the unformatted value
 
* {{cmd|convertedcounter}} - Retrieve the formatted value
 
* {{cmd|convertedcounter}} - Retrieve the formatted value
  

Revision as of 18:04, 25 August 2014

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