Difference between revisions of "Command/definecounter"
< Command
Jump to navigation
Jump to search
m (Created page with "Creates a new numeric counter. == See Also == {{cmd|incrementcounter}}") |
m |
||
(8 intermediate revisions by 3 users not shown) | |||
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: | ||
+ | |||
+ | <texcode> | ||
+ | \definecounter[EventCount] | ||
+ | [ | ||
+ | way=bytext, | ||
+ | prefix=no, | ||
+ | ] | ||
+ | |||
+ | \startTEXpage | ||
+ | \incrementcounter[EventCount] | ||
+ | \externalfigure[{\rawcountervalue[EventCount]}] | ||
+ | [ | ||
+ | height=\paperheight, | ||
+ | orientation=90, | ||
+ | ] | ||
+ | \stopTEXpage | ||
+ | </texcode> | ||
+ | |||
+ | The pictures are numbered sequentially, starting at 1. | ||
== See Also == | == See Also == | ||
− | {{cmd|incrementcounter}} | + | * [[Counters]] |
+ | * {{cmd|incrementcounter}} - Increase the counter value | ||
+ | * {{cmd|decrementcounter}} - Decrease the counter value | ||
+ | * {{cmd|rawcounter}} - Retrieve the unformatted value | ||
+ | * {{cmd|rawcountervalue}} - Retrieve the unformatted value | ||
+ | * {{cmd|convertedcounter}} - Retrieve the formatted value | ||
+ | |||
+ | == Source Code == | ||
+ | |||
+ | View the source for more details: | ||
+ | |||
+ | https://source.contextgarden.net/tex/context/base/mkiv/strc-num.mkiv |
Revision as of 05:31, 7 December 2019
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
- Counters
- \incrementcounter - Increase the counter value
- \decrementcounter - Decrease the counter value
- \rawcounter - Retrieve the unformatted value
- \rawcountervalue - Retrieve the unformatted value
- \convertedcounter - Retrieve the formatted value
Source Code
View the source for more details:
https://source.contextgarden.net/tex/context/base/mkiv/strc-num.mkiv