[Tex/LaTex] Change FORALL to FOREACH in algorithms package


\FORALL gives a "for all" loop, i would like to redefine it so that it shows "for each" instead. Any way to do that?

By the way, foreach is more often used in real programming languages than forall, is that correct?

Best Answer

Simple enough and covered in the algorithms manual:

\renewcommand{\algorithmicforall}{\textbf{for each}}

This command redefines the macro that is used to typeset \FORALL. It should be placed in the document preamble.