[Tex/LaTex] Defining a function in pseudocode


I am trying to define a function in LaTeX pseudocode, as shown below.


However, when I compile, I get the error, undefined control sequence \Function{Increment}{$a$}. What mistake am I doing here and how can I solve it?

Best Answer

Like Vikram said: use algpseudocode from the algorithmicx package, it’s superior to the other pseudocode packages.

Then you can do the following:

  \State Do Something