I MetaUML's manual, I'd like to replace sequences like:
\metaumltest{picture_stack}{1}
\metaumltest{picture_stack}{2}
\metaumltest{picture_stack}{3}
or
\metaumltest{state}{1}
\metaumltest{state}{2}
\metaumltest{state}{3}
\metaumltest{state}{4}
with a for or loop. What is the best way of doing this in LaTeX?
Thanks in advance,
Ovidiu
I think the simplest way is using the commands provided by the package
ifthen. But, if you prefer the hard way, and doing it in TeX, you can
use the \loop ... \repeat.
For instance:
\newcount\qq
\qq=1
\loop
\metaumltest{state}{\qq}
\ifnum\qq < 4 \repeat
Gianluca
package multido
\multido{\iA=1+1}{4}{\metaumltest{state}{\iA}}
Herbert
--
http://PSTricks.de/
http://TeXnik.de/
http://www.dante.de/CTAN/info/math/voss/mathmode/Mathmode.pdf
http://www.dante.de/faq/de-tex-faq/
http://www.tex.ac.uk/cgi-bin/texfaq2html?introduction=yes
Documentation for the package ifthen can be found here:
http://www-control.eng.cam.ac.uk/~pcr20/latex/ifthen.pdf
There is a \whiledo that may be what you're looking for.
(though it sounds like the multido suggestion is nicer)
You may also be interested in perlTeX.
Michele
--
>It's because the universe was programmed in C++.
No, no, it was programmed in Forth. See Genesis 1:12:
"And the earth brought Forth ..."
- Robert Israel in sci.math, thread "Why numbers?"
\newcount\qq
\qq=1
\loop
\metaumltest{font}{\qq}
\ifnum\qq < 3 \repeat
pdfLaTeX sais:
! Missing number, treated as zero.
<to be read again>
\protect
l.32 \ifnum\qq < 3 \repeat
Any ideas why?
\newcount\qq
\qq=1
\loop
metaumltest{state}{\the\qq}
\advance\qq by 1
\ifnum\qq < 5
\repeat
\usepackage{multido}
\newcommand{\metaumltest}[2]{Test #2 --- \\
\includegraphics{fig/test_#1.#2} \\ }
\newcommand{\metaumltests}[2]{\multido{\iA=1+1}{#2}{\metaumltest{#1}{\iA}}}
\subsubsection{Class tests}
\metaumltests{class}{14}
Thanks,
Ovidiu
aaaaaaaaaargh! Yes, of course.
> \ifnum\qq < 5
> \repeat
>
>
> Herbert
thank you, Herbert!
Gianluca