How can I define a new loop in algorithmicx? For example, code like this:
ex1)
PreLoop s do
–statement1
–statement2
ex2)
PostLoop s do
–statement1
–statement2
Is it possible to define it as a command?
algorithm2ealgorithmicalgorithmicxalgorithms
How can I define a new loop in algorithmicx? For example, code like this:
ex1)
PreLoop s do
–statement1
–statement2
ex2)
PostLoop s do
–statement1
–statement2
Is it possible to define it as a command?
Best Answer
Yes, this can be done using the
\algdef
command. This is an example:For more information, see the algorithmicx manual, e.g., http://mirror.unl.edu/ctan/macros/latex/contrib/algorithmicx/algorithmicx.pdf .