Difference between revisions of "Command/definecounter"

From Wiki
Jump to navigation Jump to search
m
m
(3 intermediate revisions by 3 users not shown)
Line 5: Line 5:
 
The following partial example adds a picture at the end of each chapter:
 
The following partial example adds a picture at the end of each chapter:
  
<source>
+
<texcode>
\definecounter[EventCount][
+
\definecounter[EventCount]
  way=bytext,
+
  [
  prefix=no
+
    way=bytext,
]
+
    prefix=no,
 +
  ]
  
 
\startTEXpage
 
\startTEXpage
 
   \incrementcounter[EventCount]
 
   \incrementcounter[EventCount]
   \externalfigure[{\rawcountervalue[EventCount]}][
+
   \externalfigure[{\rawcountervalue[EventCount]}]
    height=\paperheight,
+
                [
    orientation=90,
+
                  height=\paperheight,
  ]
+
                  orientation=90,
 +
                ]
 
\stopTEXpage
 
\stopTEXpage
</source>
+
</texcode>
  
 
The pictures are numbered sequentially, starting at 1.
 
The pictures are numbered sequentially, starting at 1.
Line 24: 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
Line 34: Line 37:
 
View the source for more details:
 
View the source for more details:
  
http://source.contextgarden.net/tex/context/base/strc-num.mkiv
+
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

Source Code

View the source for more details:

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