Command/recurselevel
< Command
Jump to navigation
Jump to search
\recurselevel
Syntax (autogenerated)
\recurselevel |
Syntax
\recurselevel |
Description
The iteration count in a \dorecurse, \dostepwiserecurse or \doloop block.
Example
Counting up slow: \dorecurse{10} {\recurselevel...\ } Counting down fast: \dostepwiserecurse{10}{1}{-2} {\recurselevel...\ } Counting stopped. Counting up to 3: \doloop{ \ifnum \recurselevel=3 \exitloop % exit at end of current iteration \fi \recurselevel! }
See also
- ConTeXt and Lua programming/Tutorials/System Macros/Loops and Recursion
- Looping a fixed number of times
- \dorecurse for iterating from 1 to n.
- \dostepwiserecurse for iteration with arbitrary start, end, and step.
- \recurselevel for the iteration number.
- \recursedepth for the iteration depth, in the case of nested \dorecurse and co.
- 'While' loops with exit conditions
- \doloop for a loop that repeats until exited.
- \exitloop to exit a loop.
- \exitloopnow to immediately exit a loop.
- \recurselevel to know which iteration the loop is in.
- \recursedepth to know how many nested loops deep we are.
- \input is also often used to produce dummy text.
- LuaTeX for heavier-duty looping and iterating.
Help from ConTeXt-Mailinglist/Forum
All issues with:
- recurselevel on the mailing list (all results)
- recurselevel on the mailing list (subject only)
- recurselevel on stack exchange
- recurselevel in ConTeXt's source
table cellspacing="4" cellpadding="2" class="cmd">