tags:

views:

827

answers:

6
+1  A: 

Auntie Google says yes.

Graham Lee
I am such an idiot... I searched for "iterate", but not obvious things like "for" and "loop".Thanks!
Jordi
+1  A: 

Sure it's possible. You can also recur. eplain has iteration macros in it, see, eg, here.

Charlie Martin
+2  A: 

You can use the \loop or \repeat tokens. Or the multido package.

Chuah
A: 

If you're really interested in this stuff, you also want to get hold of the TeXbook, by Knuth;

Charlie Martin
I would if he were using Plain TeX. The differences between TeX and LaTeX are great enough that Knuth's book can be a hindrance to learning LaTeX.
Jason
If he's doing things like trying to write looping macros, he's got to learn TeX. It's like trying to learn Make without learning a shell.
Charlie Martin
+1  A: 

Just make the following into a new command and be sure to use package ifthen.

\begin{tabular}{l|*{10}{c|}}
\newcounter{count}
\whiledo{\value{count}<10}{
\ifthenelse{\value{count}=0}{}{\the\value{count}}
\ifthenelse{\value{count}<9}{&}{\\}
\stepcounter{count}
}
letters&a&b&c&d&e&f&g&h&i\\
\end{tabular}
Jason
+1  A: 

Another possibility (if you're lazy like me) is perltex

Karl