[Tex/LaTex] Add a phrase to an existing algorithmic command/environment


I would like to add a new command to an existing environment. The \renewenvironment command does not help a lot since I need to copy and paste the entire environment definition.

For an example I would like to make a \FORALL_P for the algorithmic environment such that instead of producing

forall ... do 

as original \FORALL, it produces

forall ... do in parallel

Best Answer

You can say

\newcommand{\algorithmicdoinparallel}{\textbf{do in parallel}}
  \newcommand{\FORALLP}[2][default]{\ALC@it\algorithmicforall\ #2\ %

The definition of \FORALLP is modeled on that of \FORALL; you can't call it \FORALL_P, however.

Related Question