LATEX Forloop PDF
LATEX Forloop PDF
LATEX Forloop PDF
nsetzer
September 19, 2006
The forloop package defines two commands \forloop (preferred usage) and
\forLoop (deprecated).
1 Implementation
\forloop \forloop[hstepi]{hcounter i}{hinitial valuei}{hconditioni}{hcodei}
\newcounter{ct} \forloop{ct}{1}{\value{ct} < 10}{\arabic{ct} }
123456789
1 \newcommand{\forloop}[5][1]%
2 {%
3 \setcounter{#2}{#3}%
4 \ifthenelse{#4}%
5 {%
6 #5%
7 \addtocounter{#2}{#1}%
8 \forloop[#1]{#2}{\value{#2}}{#4}{#5}%
9 }%
Else
10 {%
11 }%
12 }%
1
24 \ifthenelse{\value{#4}=#3}%
25 {%
26 #5%
27 }%
28 % Else
29 {}%
30 }%
31 }
Change History
v1.0 sources . . . . . . . . . . . . . . . . . . 1
General: Initial Release . . . . . . . . 1
v3.0
v2.0
General: Re-wrote forloop com- General: total restructure of forloop
mand after discovering that command to make nested loops
whiledo took too many re- work . . . . . . . . . . . . . . . . . . . 1
Index
Numbers written in italic refer to the page where the corresponding entry is de-
scribed; numbers underlined refer to the code line of the definition; numbers in
roman refer to the code lines where the entry is used.
F \forloop . . . . . . . . . . . . . . . . . . . . . 1
\forLoop . . . . . . . . . . . . . . . . . . . . 13